On Tue May 09 2000 at 08:49, Tony Nugent wrote:
Oh dear, I should try *looking* at a command before I wildly post
replies :)
> On Mon May 08 2000 at 10:44, "Mark A. Swope" wrote:
>
> > I think that this should be simple, but I'm having some trouble with it...
> >
> > I want to execute *something* like this:
> >
> > mailx "'cat /tmp/msg.txt'" [EMAIL PROTECTED] < /dev/null
>
> mailx `cat /tmp/msg.txt` [EMAIL PROTECTED] < /dev/null
>
> or, which bash (and much better):
>
> mailx $(cat /tmp/msg.txt) [EMAIL PROTECTED] < /dev/null
mailx does not exist on many linux distros, it is simply `mail'.
(I wish mail had some of the more useful features mailx had way
back when I was using sunos/slowlaris, like autoinc).
The real way to do this is:
mail -s "$(cat /tmp/msg.txt)" [EMAIL PROTECTED] < /dev/null
I assume that you want to have your message in the Subject line
(thus the `-s' switch).
(You can add a `-v' switch to see it being delivered).
You can also pipe messages into mail (but you have to do it in a
special way or else it tends to make complains about the input
terminating early).
> > This command will be executed as an "additional" action from
> > w/in HP Openview after Openview dumps the appropriate text
> > into /tmp/msg.txt.
> >
> > When I tried the above command (from the command line),
> > I get cat /tmp/msg.txt instead of the contents of msg.txt.
> >
> > What's the correct syntax?
Hmm, that's different. If you want to mail a *file*, then do it
like this:
mail -s "pager message from Openview" [EMAIL PROTECTED] < /tmp/msg.txt
That'll work no problems. The -s subject line is optional.
Cheers
Tony