Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: is variable with variable name possible?
- X-seq: zsh-users 15925
- From: Jérémie Roquet <arkanosis@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: is variable with variable name possible?
- Date: Mon, 4 Apr 2011 16:33:48 +0200
- Cc: Stephane Chazelas <stephane_chazelas@xxxxxxxx>, zzapper <david@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=j6CvPDLIyNQ3mqv4eYi70e+KNgVjxR6tqaecslzjgnk=; b=xczSXBA3iNoIO/6HhUJlJjqIMQXAHgf1dcBZ2PCwa28heHDCeys+xRHzKu058N1XL7 8YA9k3ev8aM+GERFzB5lmCAVObt1cy/9UTlCRlA2kTVYSUewgZ7pNjsFSfsP6W7d0JJf RyAvH9r+Lo+LTvXa69EjMWLRljGMuN4Cy2JA8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=AkQJ9eH4kRg0MoDRSw9GAX+LuBoHKR8cPqqQE7NY1Av63mNKWVxCXmO1tWwF3LCwQW EpqdpbM7NID0J76hwgV7th31/QhRiqPz7WENsLT0zGLsQb6I9YTrn2OgVy1vjwHkkGMS NSI7it9L92F4meZerqK2aMHhVln1NcWnGKaVQ=
- In-reply-to: <20110404140651.GA9371@yahoo.fr>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <Xns9EBD94C46B8C1zzappergmailcom@80.91.229.10> <BANLkTimegXA4_5Co4sSWKgOmY_U-EWE6Pg@mail.gmail.com> <20110404140651.GA9371@yahoo.fr>
2011/4/4 Stephane Chazelas <stephane_chazelas@xxxxxxxx>:
> 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"
Oh, right!
--
Jérémie
Messages sorted by:
Reverse Date,
Date,
Thread,
Author