Computing.Net > Forums > Unix > Sending mails on error occurance

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Sending mails on error occurance

Reply to Message Icon

Name: anilcgowda
Date: August 15, 2005 at 08:26:50 Pacific
OS: UNIX
CPU/Ram: 1GB
Comment:

Hi,

I want to send mails to certain users if the previous step in my shell script fails. Can you guide me as to how to accomplish this. Also, was wondering how to use alarm with errors.

Thanks,
Anil



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: August 15, 2005 at 11:16:24 Pacific
Reply:

ls
RC=$?
if [ "$RC" -eq 0 ] ; then
echo "Success"
else
echo "Error" | mail user@tld.com
fi


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Sending mails on error occurance

How to send mail on UNIX to smtp mail www.computing.net/answers/unix/how-to-send-mail-on-unix-to-smtp-mail/2394.html

Send mail on UNIX www.computing.net/answers/unix/send-mail-on-unix/4064.html

UNIX can't send mail out www.computing.net/answers/unix/unix-cant-send-mail-out/2711.html