Re: graceful script exit

From: John Jolet (john.jolet@FXFN.COM)
Date: Fri Apr 23 2004 - 12:12:42 EDT


doing this in korn? Here's what I do...set a errcounter=0 at the top.
after each command, if [[ $? != 0 ]]; then errcounter="errcounter + 1"

then at the end, if [[ $errcounter != 0 ]]; then echo some stuff

okay, so some of that syntax won't exactly work, but from the top of my
head, that's the general idea.

Bob.Kelley@BRINKSINC.COM wrote:

>If I have a script with does a number of things like tars, copy commands,
>etc. What is the best way to generate a flag if a SINGLE command in the
>script fails? In other words, if I'm thinking about this correctly, I want
>to get a page when the script is finished, and one command didn't finish
>correctly, even if some of the commands have succeeded. Thanks!
>
>Bobby Kelley Jr.
>972-877-5341
>
>



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:51 EDT