On Fri, 8 Oct 2010, Ted Unangst wrote:
...
> > The issue isn't that the behavior and the documentation don't match.  The
> > issue, perhaps not clearly stated, is that the behavior isn't what is
> > required by POSIX/SUS.
> 
> POSIX says nearly the same as we do.
> 
> When this option is on, if a simple command fails for any of the reasons 
> listed in Consequences of Shell Errors or returns an exit status value 
> >0, and is not part of the compound list following a while, until, or if 
> keyword, and is not a part of an AND or OR list, and is not a pipeline 
> preceded by the ! reserved word, then the shell shall immediately exit.
> 
> http://www.opengroup.org/onlinepubs/009695399/utilities/set.html

There was a big discussion about this text on the austin-group mailing 
list some time ago and it was concluded that the text was wrong, that it 
never matched the behavior of the original shells that it was intended to 
be modeled on.  As a result, an interpretation ("enhancement request") was 
released that updated the wording for the next version of the spec.  I 
thought this had happened long enough ago so as to make it into the 2008 
spec, but checking the site I see it was only in Feb 2009 that this 
happened.  Oh well.

You can find the enhancement request here
        http://www.opengroup.org/austin/aardvark/latest/xcubug3.txt

Search for "set -e" in that.


Links that and the approved enhancements for the other sections of the 
SUS spec can be found at
        http://www.opengroup.org/austin/aardvark/latest/


Philip

Reply via email to