Stupid scripting question -- FAQ-ish
Tim Wunder
tim
Mon May 17 11:43:15 PDT 2004
On 1/20/2003 11:28 AM, someone claiming to be Roger Oberholtzer wrote:
> On Mon, 20 Jan 2003 11:09:52 -0500
> Tim Wunder <tim at thewunders.org> wrote:
>
>
>>Hi,
>>I have a rudimentary script that checks out and compiles the latest
>>GNUCash from CVS. I'd like to have it send me an e-mail when it
>>completes telling me that the new GnuCash is ready for installation, or
>>that the update failed.
>>
>>So, essentially, my question is: How do I send a mail message from the
>>command line without requiring additional user input?
>>
>>A quick search on google hasn't yielded much help for me (probly not
>>using the right search terms).
>
>
> How about this?
>
> cat << *EOF* | sendmail -N failure -n -R hdrs -U -fme at here -- you at there
> Subject: GNUCash update
> It is finished
> *EOF*
>
>
> The *EOF* are literal strings and can be anything. You can also cat a file
> or echo text. Whatever makes you happy. The 'secret' is in the options to
> sendmail.
>
> This example is sent from me at here to 'you at there'. There can be more. It
> works for all users who can send mail.
>
> You may need to replace 'sendmail' with '/usr/sbin/sendmail' or wherever
> sendmail is.
>
>
Cool. Thanks. BTW, my sendmail complained about the -U
(sendmail-8.12.5-7, RH 8.0), I removed it and it worked. Now to figger
out how to include the contents of an environment variable in the script
and make it so the To: doesn't get displayed as
"undisclosed-recipients"... Hopefully, 'man sendmail' will help ;-)
Thanks again,
Tim
More information about the Linux-users
mailing list