On Mon, 4 Dec 2000, praedor wrote:

> I am almost there with this command:
> 
> mail -s "ip update message" [EMAIL PROTECTED]
> 
> This will produce a message with a subject of "ip update message" and add my 
> email to the "To:" field.  It does leave an empty message body and doesn't 
> send a "ctrl-d" command to mail which is required to sending.  How do I do 
> that?

If you 'echo' something and pipe it into the mail command, when the
echo finishes it will send an End Of File (the equivalent of a
ctrl-d) to mail. So, you can use an incantation similar to this one:

echo | mail -s "ip update message" [EMAIL PROTECTED]

or, if you really want to get fancy:

echo "mail from `hostname` at `hostname -i`" | mail -s "ip
update message" [EMAIL PROTECTED]

(note: should all be one line)

Take a look at the "Command Substitution" section of "man bash" to see
what the "`"'s are doing, and "man hostname" to see what hostname is
doing.

- Jeff



Keep in touch with http://mandrakeforum.com: 
Subscribe the "[EMAIL PROTECTED]" mailing list.

Reply via email to