Re: How: exit on error?
From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 05/31/04
- Next message: Erik Max Francis: "Re: How: exit on error?"
- Previous message: J Krugman: "How: exit on error?"
- In reply to: J Krugman: "How: exit on error?"
- Next in thread: J Krugman: "Re: How: exit on error?"
- Reply: J Krugman: "Re: How: exit on error?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 30 May 2004 20:29:12 -0400
In article <c9dtnl$j1q$1@reader2.panix.com>,
J Krugman <jkrugman345@yahbitoo.com> wrote:
> Is there a way to configure the running of a bash script so that
> any error will cause the entire script to exit (with an appropriate
> non-zero exit status)? I.e., to make something like this
set -e
>From the man page:
-e Exit immediately if a simple command (see SHELL GRAMMAR
above) exits with a non-zero status. The shell does not
exit if the command that fails is part of an until or
while loop, part of an if statement, part of a && or ||
list, or if the command's return value is being inverted
via !. A trap on ERR, if set, is executed before the
shell exits.
-- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***
- Next message: Erik Max Francis: "Re: How: exit on error?"
- Previous message: J Krugman: "How: exit on error?"
- In reply to: J Krugman: "How: exit on error?"
- Next in thread: J Krugman: "Re: How: exit on error?"
- Reply: J Krugman: "Re: How: exit on error?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|