bin/111343: sh(1) and bash(1) with -e sometimes fail to test errors in functions

Jilles Tjoelker jilles at stack.nl
Sun Sep 13 22:50:07 UTC 2009


The following reply was made to PR bin/111343; it has been noted by GNATS.

From: Jilles Tjoelker <jilles at stack.nl>
To: bug-followup at FreeBSD.org, melkov at 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


More information about the freebsd-bugs mailing list