Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: is variable with variable name possible?
- X-seq: zsh-users 15922
- From: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
- To: Jérémie Roquet <arkanosis@xxxxxxxxx>
- Subject: Re: is variable with variable name possible?
- Date: Mon, 4 Apr 2011 15:06:51 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>, zzapper <david@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.fr; s=s1024; t=1301926012; bh=pY+vktnzeYWdEeCzRk71dafMobvreTKuowEVZ4J2I1E=; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:Content-Transfer-Encoding:In-Reply-To:User-Agent; b=pqoouOhtbPT/NSdceQ9KeyBo4iqe8xpYNrO8yaPV5vX2Rb13FQvGNpCdEBWLfCC8Nl72ulmSmzW9VUfAi4N7oGybVizSydJqetfKdpagsYI7AGpMpuS9BRwSKB1eJXbPSr2t++nGf/YNJNRiM2axCZ7Zsr6EiH+3HaXC4DMoR5o=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=DKIM-Signature:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:Content-Transfer-Encoding:In-Reply-To:User-Agent; b=bnUMsxSKQy8+/B/x7PYyXR8OD6HZc7EJSotQ3+AbaFxyMVgdGc64wpWsf5cHuQURJSrv1yMigAxNsUmHfaz9JdBySXvlmedUAH/JN7yKV14HphpviUvoCMkMhqOZLvUxvQEdhxNk4CxqkBJ44cIsYgj0ymbgy18NlrSXaqDggds= ;
- In-reply-to: <BANLkTimegXA4_5Co4sSWKgOmY_U-EWE6Pg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-followup-to: Jérémie Roquet <arkanosis@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>, zzapper <david@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <Xns9EBD94C46B8C1zzappergmailcom@80.91.229.10> <BANLkTimegXA4_5Co4sSWKgOmY_U-EWE6Pg@mail.gmail.com>
2011-04-04 15:48:32 +0200, Jérémie Roquet:
[...]
> 2011/4/4 zzapper <david@xxxxxxxxxx>:
> > somevar=$(pwd)
> >
> > but I want somevar to be a variable name
>
> $ eval "$somevar=$(pwd)"
[...]
No!
eval "$somevar=\$(pwd)"
or
eval "$somevar=\$PWD"
Or think of what would happen if $PWD was "/tmp/x;rm -rf /home"
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author