From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11598 invoked from network); 2 Feb 2005 22:44:23 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 2 Feb 2005 22:44:23 -0000 Received: (qmail 12774 invoked from network); 2 Feb 2005 22:44:12 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Feb 2005 22:44:12 -0000 Received: (qmail 15088 invoked by alias); 2 Feb 2005 22:43:52 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8455 Received: (qmail 15079 invoked from network); 2 Feb 2005 22:43:51 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Feb 2005 22:43:51 -0000 Received: (qmail 11500 invoked from network); 2 Feb 2005 22:43:51 -0000 Received: from unknown (HELO vrs.michael-prokop.at) (81.223.126.153) by a.mx.sunsite.dk with SMTP; 2 Feb 2005 22:43:49 -0000 Received: from localhost (unknown [81.223.126.153]) by vrs.michael-prokop.at (Postfix) with ESMTP id 64B831048F for ; Wed, 2 Feb 2005 23:43:31 +0100 (CET) Date: Wed, 2 Feb 2005 23:43:30 +0100 From: Michael Prokop To: zsh-users@sunsite.dk Subject: Re: handling of variables Message-ID: <2005-02-02T23-41-32@devnull.michael-prokop.at> Reply-To: Michael Prokop Mail-Followup-To: zsh-users@sunsite.dk References: <2005-02-01T12-49-14@devnull.michael-prokop.at> <200502011410.j11EAA9D029705@news01.csr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200502011410.j11EAA9D029705@news01.csr.com> X-URL: http://www.michael-prokop.at/ X-Operating-System: Debian GNU/Linux - 2.6.8.1 on a i686 X-Registered-Linux-User: 224337 X-Crypto: GnuPG/1.2.3 http://www.gnupg.org X-GPG-Key-ID: 0x37E272E8 X-GPG-Key: http://www.michael-prokop.at/gpg X-GPG-Fingerprint: 04AE E62C 9502 CD34 A7DA 857B D8DF 53FB 37E2 72E8 User-Agent: Mutt/1.5.7+20050129i 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 * Peter Stephenson [20050201 15:51]: > Michael Prokop wrote: > > 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. Thanks for explanation, Peter. > > 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. Ok. ;-) Thanks also to Stephane for his explanation! thx && regards, -mika-