[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -e does not work with subscript

From: Linda Walsh
Subject: Re: -e does not work with subscript
Date: Tue, 29 Jan 2008 15:52:01 -0800
User-agent: Thunderbird (Windows/20071031)

Stepan Koltsov wrote:
BTW, my use case for "(false)" is:

set -e
( cd some-dir && make )
( cd other-dir && ./build.sh )
( cd third-dir && ant )

Most readers (and writers) expect script to fail if "make" failed. So
I think that outer bash should exit with error on "(false)" :-)
        I wouldn't, since you are placing the ops in a subshell --
only the subshell has the "error", but the top level shell wouldn't
have an error just because a subshell exited.  If you want the
shell to exit, use braces:

{ cd some-dir &* make ; }   
#   braces don't parse as end-of-line delimiters
#   like parens do, so the semicolon is needed after make

reply via email to

[Prev in Thread] Current Thread [Next in Thread]