Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: using the "source" command in a "for" loop
- X-seq: zsh-users 580
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: luomat@xxxxxxxx
- Subject: Re: using the "source" command in a "for" loop
- Date: Fri, 3 Jan 1997 00:12:48 +0100 (MET)
- Cc: greg@xxxxxxxx, zsh-users@xxxxxxxxxxxxxxx
- In-reply-to: <199701022112.NAA14675@xxxxxxxx> from Timothy J Luoma at "Jan 2, 97 04:12:23 pm"
> > # need to export the vars, or they're lost when leaving the loop
No, they are not lost.
> I guess something changed because this even worked for 3.0.0. No
> matter, as long as it works now
>
> I changed:
> $i="$ZDOTDIR/$i"
> to
> export $i="$ZDOTDIR/$i"
The first version does not work because zsh tries to assign the parameter
named `$i'. You have to use eval to assign the value of $i. Although this
worked without eval up to zsh-3.0.0 it was never documented. You can use
eval $i='"$ZDOTDIR/$i"'
Zoltan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author