Hi:

     I have a shell script that needs to send email via mailx. The content of 
the email is just a
string containing either "Success" or "Failure". So far it seems that there are 
2 ways of doing it
namely:


    a) Using a temporary file
       echo "Success" > "/tmp/my_mail.$$"  
       mailx -s "Test Result" [EMAIL PROTECTED] < /tmp_my_mail.$$
       rm -f /tmp/my_mail.$$

    b) using a heredoc
       mailx -s "Test Result" [EMAIL PROTECTED] <<END_OF_MAIL
Success
END_OF_MAIL

     Is there another way of doing it? It seems that using temporary file is an 
overkill for a one
line message, and heredocs tends to clutter the indentation of the script. I 
tried :
         echo "Success" | mailx -s "Test Result" [EMAIL PROTECTED]
     but it fails.

     Any other ideas?

Regards,
Ludwig

P.S. :  Sorry about the mail a while ago. I think I accidentally pressed some 
keys that caused the
mail to be send before it was finished.





      
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
http://lists.linux.org.ph/mailman/listinfo/plug
Searchable Archives: http://archives.free.net.ph

Reply via email to