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')



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

From: Aleksey Cheusov <cheusov%tut.by@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: tron%NetBSD.org@localhost,  netbsd-bugs%netbsd.org@localhost,  
gnats-admin%netbsd.org@localhost
Subject: Re: bin/38736 (/bin/sh: several problems with 'set -e')
Date: Sun, 01 Jun 2008 20:29:08 +0300

  >> 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