Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Sep 2009 22:50:07 GMT
From:      Jilles Tjoelker <jilles@stack.nl>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/111343: sh(1) and bash(1) with -e sometimes fail to test errors in functions
Message-ID:  <200909132250.n8DMo7SW095587@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/111343; it has been noted by GNATS.

From: Jilles Tjoelker <jilles@stack.nl>
To: bug-followup@FreeBSD.org, melkov@comptek.ru
Cc:  
Subject: Re: bin/111343: sh(1) and bash(1) with -e sometimes fail to test
	errors in functions
Date: Mon, 14 Sep 2009 00:43:27 +0200

 Replacing the function call with the function definition, the behaviour
 seems reasonable. The command is tested, so -e should not trigger.
 
 In general, set -e is not a good idea for more complicated scripts
 because its rules can be confusing and inconsistent across shells. You
 can achieve a similar effect by putting '|| exit' after commands.
 
 -- 
 Jilles Tjoelker



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909132250.n8DMo7SW095587>