From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20321 invoked from network); 1 Feb 2005 14:36:33 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 1 Feb 2005 14:36:33 -0000 Received: (qmail 3035 invoked from network); 1 Feb 2005 14:36:26 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 Feb 2005 14:36:26 -0000 Received: (qmail 6063 invoked by alias); 1 Feb 2005 14:36:19 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8452 Received: (qmail 6049 invoked from network); 1 Feb 2005 14:36:18 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 1 Feb 2005 14:36:18 -0000 Received: (qmail 1822 invoked from network); 1 Feb 2005 14:35:42 -0000 Received: from unknown (HELO mailsweeperjp.CSR.COM) (202.214.225.228) by a.mx.sunsite.dk with SMTP; 1 Feb 2005 14:35:37 -0000 Received: from exchangejp.csr.com (unverified) by mailsweeperjp.CSR.COM (Content Technologies SMTPRS 4.3.1) with ESMTP id for ; Tue, 1 Feb 2005 23:16:36 +0900 Received: from exchange03.csr.com ([10.100.137.60]) by exchangejp.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 1 Feb 2005 14:10:17 +0000 Received: from news01.csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 1 Feb 2005 14:10:11 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.1/8.12.11) with ESMTP id j11EAB4P029708 for ; Tue, 1 Feb 2005 14:10:11 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.13.1/8.13.1/Submit) with ESMTP id j11EAA9D029705 for ; Tue, 1 Feb 2005 14:10:11 GMT Message-Id: <200502011410.j11EAA9D029705@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-users@sunsite.dk Subject: Re: handling of variables In-reply-to: <2005-02-01T12-49-14@devnull.michael-prokop.at> References: <2005-02-01T12-49-14@devnull.michael-prokop.at> Date: Tue, 01 Feb 2005 14:10:09 +0000 From: Peter Stephenson X-OriginalArrivalTime: 01 Feb 2005 14:10:11.0975 (UTC) FILETIME=[BE726970:01C50867] X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Michael Prokop wrote: > Hello, > > I'm just wondering about: > > % zsh -f > % FOO=BAR /bin/echo "$FOO" > > % > > Why doesn't this work? Am I running out of coffee? :) The sequence of interepretation is line gets parsed to line gets expanded to /bin/echo "" (assuming FOO is currently empty) shell forks FOO=BAR is put in the environment shell execs /bin/echo "" Compare this with the result of FOO=BAR printenv FOO where the command itself examines the environment. > And I'm wondering what's happening at: > > % zsh -f > % FOO=BAR BAR=FOO echo $FOO $BAR > > % FOO=BAR BAR=FOO echo $FOO $BAR > BAR > % This looks suspiciously like a bug. The value of BAR is being restored after the echo, but the value of FOO isn't. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************