From owner-freebsd-bugs Mon Oct 14 17:12:18 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA07913 for bugs-outgoing; Mon, 14 Oct 1996 17:12:18 -0700 (PDT) Received: from gallup.cia-g.com (root@gallup.cia-g.com [206.206.162.10]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id RAA07908 for ; Mon, 14 Oct 1996 17:12:14 -0700 (PDT) Received: from localhost.my.domain (dialup1.gup.cia-g.com [206.206.162.33]) by gallup.cia-g.com (8.7.6/8.6.12) with SMTP id SAA04352; Mon, 14 Oct 1996 18:12:09 -0600 (MDT) Message-ID: X-Mailer: XFMail 0.4 [p0] on FreeBSD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Mon, 14 Oct 1996 18:00:00 -0600 (MDT) From: George Simunovich To: Steve Price Subject: Re: bin/1793: /bin/sh return w/o exitstatus in a function sets e Cc: freebsd-bugs@freefall.freebsd.org Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On 14-Oct-96 Steve Price wrote: >>On Sun, 13 Oct 1996 george@cia-g.com wrote: > ># ># >Number: 1793 ># >Category: bin ># >Synopsis: /bin/sh return w/o exitstatus in a function sets exitstatus to true ># >Confidential: no ># >Severity: non-critical ># >Priority: low ># >Responsible: freebsd-bugs ># >State: open ># >Class: sw-bug ># >Submitter-Id: current-users ># >Arrival-Date: Sun Oct 13 20:10:01 PDT 1996 ># >Last-Modified: ># >Originator: George Simunovich ># >Organization: ># >Release: 2.2-current ># >Environment: ># 2.2-CURRENT FreeBSD 2.2-CURRENT #0: Sat Oct 12 13:26:46 MDT 1996 ># >Description: ># A return without an exit status in a sh functino sets the exit status ># to true. ># ># bash works as does /bin/sh on FreeBSD 2.1.0-RELEASE ># >How-To-Repeat: ># When the following script is run it echos "True Condition". ># ># #!/bin/sh ># ># Tester() ># { ># false ># return ># } ># ># if Tester ># then ># echo "True Condition" ># else ># echo "Not True Condition" ># fi ># ># >Fix: ># use bash? ># ># >Audit-Trail: ># >Unformatted: ># > >Try doing a 'return $?' to return the exitstatus of the previously >executed command. Attached is a one-liner that fixes the case above >but breaks this new case (at least wrt /bin/bash). > >steve[~]$ cat > testing >tester() >{ > return >} > >false > >if tester >then > echo "true" >else > echo "false" >fi >^D >steve[~] /tmp/sh testing >true >steve[~] /bin/bash testing >false >steve[~] > >I will look into this some more and see what I can find. > >Steve > The return problem was caused by the stock HylaFAX 4.0pl0 configure script which uses the return without an exit status. George