Subject: bin/32282: set -e - difference between /bin/sh and /bin/ksh
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <pstoeber@uni-potsdam.de>
List: netbsd-bugs
Date: 12/12/2005 03:05:01
>Number:         32282
>Category:       bin
>Synopsis:       set -e - difference between /bin/sh and /bin/ksh
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 12 03:05:00 +0000 2005
>Originator:     Paul Stoeber
>Release:        3.0 RC5
>Organization:
>Environment:
NetBSD  3.0_RC5 NetBSD 3.0_RC5 (GENERIC_LAPTOP) #0: Thu Dec  1 01:51:05 UTC 2005  builds@b4.netbsd.org:/home/builds/ab/netbsd-3-0-RC5/i386/200511302123Z-obj/home/builds/ab/netbsd-3-0-RC5/src/sys/arch/i386/compile/GENERIC_LAPTOP i386
>Description:
$ /bin/sh -c 'set -e; true | false; echo $?'
1
$ /bin/sh -c 'set -e; (false); echo $?'
1
$ /bin/ksh -c 'set -e; true | false; echo $?'
$ /bin/ksh -c 'set -e; (false); echo $?'
$ 

I don't know if uniformity is desired here.
I find ksh's behavior less surprising, because it's closer to the "if something goes wrong, stop" meaning of set -e.
>How-To-Repeat:

>Fix:
modify src/bin/sh/eval.c ?