Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: handling of variables
- X-seq: zsh-users 8455
- From: Michael Prokop <news@xxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: handling of variables
- Date: Wed, 2 Feb 2005 23:43:30 +0100
- In-reply-to: <200502011410.j11EAA9D029705@xxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <2005-02-01T12-49-14@xxxxxxxxxxxxxxxxxxxxxxxxx> <200502011410.j11EAA9D029705@xxxxxxxxxxxxxx>
- Reply-to: Michael Prokop <zsh@xxxxxxxxxxxxxxxxx>
* Peter Stephenson <pws@xxxxxxx> [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 <environment-assignment> <command+args>
> 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-
Messages sorted by:
Reverse Date,
Date,
Thread,
Author