On Mon, Nov 9, 2009 at 3:37 PM, Greg Wooledge <wool...@eeg.ccf.org> wrote: > On Mon, Nov 09, 2009 at 08:39:57AM +0200, Ciprian Dorin, Craciun wrote: >> But then how can I solve the problem? (How about `()` which >> clearly is a new shell instance.) > > The problem being "how to use set -e in a consistent manner across all > shells"? You can't. set -e is unpredictable, unreliable, and should be > shunned. As you can see by the last dozen or so message on this mailing > list, not even bash gurus (other than Chet) can figure out its semantics. > > Check for errors yourself on the commands that matter. That way you'll > know what will cause termination and what won't. Yes, I know, it means > your script is longer. But longer is better than unpredictable.
Unfortunately I'm not subscribed to this mailing list. Could you point me to the right thread? Thanks, Ciprian. P.S.: The fact that some features of Bash, mainly `set -e`, which should be a safety-net for scripts, is "unpredictable" is not so very reassuring... More-over the entire Linux / Unix software infrastructure is based on Bash, from init scripts, to complex applications (like makepkg in ArchLinux, or the installers that come with enterprise software (Oracle, VMWare, etc.)...) P.P.S.: Really, I'm scared now... :(