--- Bo Ørsted Andresen <[EMAIL PROTECTED]> wrote:

> It's quite common is bash scripts to define a
> function named die:
> 
> die() {
>     echo "$@"
>     exit 1
> }

Or, with use of a specific return code:
die() {
  RT=$1
  shift
  echo "$@"
  exit $RT
}

and call it either with the error code of the previous
program:
> vobcopy -m || die $? "vobcopy failed"
or your own return code
> vobcopy -m || die 58 "vobcopy failed"

Just a point a detail, if it can be useful...

G. Moko


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-- 
[email protected] mailing list

Reply via email to