From owner-freebsd-bugs Fri Apr 25 12:30:04 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id MAA06471 for bugs-outgoing; Fri, 25 Apr 1997 12:30:04 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id MAA06461; Fri, 25 Apr 1997 12:30:02 -0700 (PDT) Resent-Date: Fri, 25 Apr 1997 12:30:02 -0700 (PDT) Resent-Message-Id: <199704251930.MAA06461@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, scotto@remuda.com Received: from popeye.remuda.com (fisbin.remuda.com [205.153.153.59]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id MAA06303 for ; Fri, 25 Apr 1997 12:27:30 -0700 (PDT) Received: (from scotto@localhost) by popeye.remuda.com (8.6.12/8.6.12) id MAA08948; Fri, 25 Apr 1997 12:25:05 -0700 Message-Id: <199704251925.MAA08948@popeye.remuda.com> Date: Fri, 25 Apr 1997 12:25:05 -0700 From: scotto@remuda.com Reply-To: scotto@remuda.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/3388: /bin/sh doesn't return correct exit status Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 3388 >Category: bin >Synopsis: /bin/sh doesn't return correct exit status >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Apr 25 12:30:01 PDT 1997 >Last-Modified: >Originator: Scott Overholser >Organization: >Release: FreeBSD 2.2.0-RELEASE i386 >Environment: FreeBSD 2.2.0 systems in general >Description: A return in a /bin/sh script should return the exit status of the preceeding command. /bin/sh under FreeBSD 2.2.0-R does not - it returns 0. FreeBSD 2.1.x does not exhibit this problem. This behavior breaks many /bin/sh scripts. >How-To-Repeat: Execute the following commands: $ /bin/sh $ f() return 78 $ g() { f return } $ h() { f } $ f ; echo $? 78 # this is the observed result - it is correct $ g ; echo $? 0 # this is the observed result - it is wrong. we should see 78 here $ h ; echo $? 78 # this is the observed result - it is correct $ exit >Fix: >Audit-Trail: >Unformatted: