NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/38736 (/bin/sh: several problems with 'set -e')



 >> At least one of your examples ("! true") is explicitly listed as an
 >> exception of the "set -e" behaviour in the POSIX spec:

 >> http://www.opengroup.org/onlinepubs/000095399/utilities/set.html
> No. You read this spec incorrectly.

You was right. The example with '!' was bad but not because
it is listed as an exception. Anyway, forget about it.

As was discussed in tech-userlevel@, another example 'false && false'
was also bad. /bin/sh currently works just like most other shells.
Spec says only about failures of 'Simple commands'.

'set -e' + pipe is fixed in revision 1.93.

Another example, background pipe + 'wait <pid>',
still needs to be fixed.

P.S.
Three repetitions of 'do_etest = !(flags & EV_TESTED);' look
ugly. Why not to treat 'do_etest variable as boolean,
checking '!(flags & EV_TESTED)' once and write do_etest=0|1 instead?

-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index