Aggh, you've just sparked an old suppressed memory.

I had to build this huge BIND install and hardening
script one time. I created a function for just about
every task in the script and used a function like that
to check return values. In each of the task functions,
I'd set a variable for function name (func_name).

Something like:

check_return ()
{
  if [ $? -ne 0 ]
    then
       echo "$func_name went foobar"
    else
       echo "A-OK"
  fi
}

I'm no shell guru. Isn't there a better way to do
error checking in huge shell scripts? Or is the
answer: 

"Use python"

Damn python bigots.

See y'all tonight.

Jason

Garl wrote:
> 
>Another way to do this would be to assign $? to a
>variable and test the variable. That way you can add
>logic to your script to return the error code and
what >it means. This is nice when you are trying to
figure >out why your script failed 2 years after you
wrote it.



__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
_______________________________________________
EuG-LUG mailing list
[EMAIL PROTECTED]
http://mailman.efn.org/cgi-bin/listinfo/eug-lug

Reply via email to