Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: aliases not getting expanded inside functions?
- X-seq: zsh-users 5643
- From: Carlos Carvalho <carlos@xxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: aliases not getting expanded inside functions?
- Date: Fri, 3 Jan 2003 15:24:04 -0200
- In-reply-to: <20030103164552.A28966@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <15893.44217.393956.262362@xxxxxxxxxxxxxx> <20030103164552.A28966@xxxxxxxxxxx>
Phil Pennock (Phil.Pennock@xxxxxxxxxxx) wrote on 3 January 2003 16:45:
>% bar='Fred Bloggs'
>% foo='bar'
>% function escr { print ${(P)foo} }
>% escr
>Fred Bloggs
>
>Is the above sufficient?
Unfortunately no, because I don't need it only for printing, but for
referencing as well. I have an array and I'd like to access the
elements by more meaningful names, so I tried to do
% alias -g guess_what='array[1]', etc.
Your suggestion doesn't work however when an assignment has to be made
to guess_what.
>You might wish to read zshexpn(1), since there are many other weird and
>wonderful ways in which zsh can pervert your data on demand.
I did but didn't see this possibility. In fact I still don't see...
What's the relation between recognizing the same escape sequences as
print and making a substitution? I'd be grateful for an explanation.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author