From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13174 invoked from network); 25 Sep 1998 10:58:34 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 25 Sep 1998 10:58:34 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id GAA06253; Fri, 25 Sep 1998 06:48:01 -0400 (EDT) Resent-Date: Fri, 25 Sep 1998 06:48:01 -0400 (EDT) Message-Id: <199809251050.LAA23017@diamond.tao.co.uk> Subject: Re: Insidious exit status bugs To: pws@ibmth.df.unipi.it (Peter Stephenson) Date: Fri, 25 Sep 1998 11:50:57 +0100 (BST) From: "Zefram" Cc: zsh-workers@math.gatech.edu In-Reply-To: <9809251009.AA12696@ibmth.df.unipi.it> from "Peter Stephenson" at Sep 25, 98 12:09:50 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"pxWXJ1.0.eX1.XJt2s"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4396 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Peter Stephenson wrote: >First: the exit status from the `...` or $(...) is being explicitly >passed back as lastval, i.e. $?. Why??? There's a variable cmdoutval >whose only function in life is to remember that status to be assigned >to lastval, so someone thought it was a good idea. Assignments such as foo=$(grep -l foo *) are supposed to set $? to the exit status of the $() command. POSIX.2 clause 3.9.1 requires this. -zefram