Subject: bin/17515: bourne shell subshell exit status handling broken
To: None <gnats-bugs@gnats.netbsd.org>
From: Antti Kantee <pooka@cubical.fi>
List: netbsd-bugs
Date: 07/08/2002 12:38:47
>Number: 17515
>Category: bin
>Synopsis: bourne shell subshell exit status handling broken
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jul 08 02:39:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Antti Kantee
>Release: NetBSD 1.6_BETA1
>Organization:
Cubical Solutions Ltd.
>Environment:
System: NetBSD nethack.cs.hut.fi 1.6_BETA1 NetBSD
Architecture: sparc
ksh also is broken.
>Description:
Run the following script:
--- SNIP ---
#!/bin/sh
set -e
(false)
echo $?
false
echo $?
--- SNIP ---
Observe it print "1", when it should really not print anything.
>How-To-Repeat:
See above.
>Fix:
This behaviour was broken in sh by eval.c rev. 1.58, which
was supposed to fix bin/11542. I'm not going to argue whether
that PR is correct or not, but at least the current behaviour
is broken.
>Release-Note:
>Audit-Trail:
>Unformatted: