NetBSD Problem Report #17515
Received: (qmail 6750 invoked by uid 605); 8 Jul 2002 09:38:51 -0000
Message-Id: <200207080938.g689clr09586@nethack.cs.hut.fi>
Date: Mon, 8 Jul 2002 12:38:47 +0300 (EEST)
From: Antti Kantee <pooka@cubical.fi>
Sender: gnats-bugs-owner@netbsd.org
Reply-To: pooka@cubical.fi
To: gnats-bugs@gnats.netbsd.org
Subject: bourne shell subshell exit status handling broken
X-Send-Pr-Version: 3.95
>Number: 17515
>Category: bin
>Synopsis: bourne shell subshell exit status handling broken
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Jul 08 09:39:01 +0000 2002
>Closed-Date: Wed Jun 30 09:41:15 +0000 2004
>Last-Modified: Wed Jun 30 09:41:15 +0000 2004
>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:
State-Changed-From-To: open->closed
State-Changed-By: mycroft
State-Changed-When: Wed Jun 30 09:40:43 UTC 2004
State-Changed-Why:
This is the correct behavior of the shell.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.