Stupid scripting question -- FAQ-ish

Roger Oberholtzer roger
Mon May 17 11:43:15 PDT 2004


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.


-- 
+????????????????????????????+???????????????????????????????+
? Roger Oberholtzer          ?   E-mail: roger at opq.se        ?
? OPQ Systems AB             ?      WWW: http://www.opq.se/  ?
? Erik Dahlbergsgatan 41-43  ?    Phone: Int + 46 8   314223 ?
? 115 34 Stockholm           ?   Mobile: Int + 46 733 621657 ?
? Sweden                     ?      Fax: Int + 46 8   302602 ?
+????????????????????????????+???????????????????????????????+


More information about the Linux-users mailing list