bin/124748: [patch] sh(1): sh -c 'exit -1' fails with "Illegal number: -1", instead of exiting with a code of 255

Jilles Tjoelker jilles at stack.nl
Sun Apr 26 14:50:03 UTC 2009


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

From: Jilles Tjoelker <jilles at stack.nl>
To: bug-followup at FreeBSD.org, gcooper at FreeBSD.org
Cc:  
Subject: Re: bin/124748: [patch] sh(1): sh -c 'exit -1' fails with "Illegal
	number: -1", instead of exiting with a code of 255
Date: Sun, 26 Apr 2009 16:40:46 +0200

 Do people actually use 'exit -1' instead of the clearer 'exit 255'? '-1'
 is not an unsigned integer, so not a posix compliant parameter to the
 exit special builtin. Even then, sh still aborts a script with a nonzero
 exit code if exit is used wrongly like this.
 
 -- 
 Jilles Tjoelker


More information about the freebsd-bugs mailing list