Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: simple substitution?
- X-seq: zsh-users 14300
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: simple substitution?
- Date: Wed, 12 Aug 2009 13:57:02 +0200
- In-reply-to: <20090812133916.6ab5adcf.tartifola@xxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20090812133916.6ab5adcf.tartifola@xxxxxxxxx>
tartifola@xxxxxxxxx <tartifola@xxxxxxxxx>:
> I'm trying to understand expansion end substitution and I'm lost in
> what should be a simple substitution. Here my example
>
> >foo=4
> >echo ${foo}
> 4
> >FO=fo
> >O=o
> >echo \${${FO}${O}}
> ${foo}
>
> while I was expecting '4'. What am I missing?
What would make you think that in the first place?
You can get that effect by doing:
[snip]
foo=4
FO=fo
O=o
print ${(P)${:-$FO$O}}
[snap]
Details can be found in 'man zshexpn'.
Regards, Frank
Messages sorted by:
Reverse Date,
Date,
Thread,
Author