[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Terminate calling bash script upon receiving non zero re
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] Terminate calling bash script upon receiving non zero return status (and possibly terminate calling script recursively) |
Date: |
Mon, 23 Apr 2012 11:25:57 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Mon, Apr 23, 2012 at 10:20:25AM -0500, Peng Yu wrote:
> I wasn't aware of '-e' before. But it seems to be what I am looking
> for. See the example below.
IT'S A TRAP!
> I don't get when it is going to fail and when it is confusing. Would
> you please let me know what you mean here?
http://mywiki.wooledge.org/BashFAQ/105
Short example for the impatient:
imadev:~$ cat foo
set -e
i=0
((i++))
echo "i is $i"
imadev:~$ bash-4.0 foo
i is 1
imadev:~$ bash-4.1 foo
imadev:~$