zsh-users
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: luomat@peak.org
Cc: greg@iweb.net, zsh-users@math.gatech.edu
Subject: Re: using the "source" command in a "for" loop
Date: Fri, 3 Jan 1997 00:12:48 +0100 (MET)	[thread overview]
Message-ID: <199701022312.AAA00632@hzoli.ppp.cs.elte.hu> (raw)
In-Reply-To: <199701022112.NAA14675@PEAK.ORG> 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


  reply	other threads:[~1997-01-03  0:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3.0.32.19970102160304.0098b380@ns1.iweb.net>
1997-01-02 21:12 ` Timothy J Luoma
1997-01-02 23:12   ` Zoltan Hidvegi [this message]
1997-01-03  0:19     ` Timothy J Luoma
1997-01-03  0:51       ` Zoltan Hidvegi
1997-01-02 20:08 Timothy J Luoma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199701022312.AAA00632@hzoli.ppp.cs.elte.hu \
    --to=hzoli@cs.elte.hu \
    --cc=greg@iweb.net \
    --cc=luomat@peak.org \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).