From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14449 invoked from network); 3 Jan 2003 17:24:27 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 3 Jan 2003 17:24:27 -0000 Received: (qmail 3340 invoked by alias); 3 Jan 2003 17:24:14 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5643 Received: (qmail 3327 invoked from network); 3 Jan 2003 17:24:13 -0000 From: Carlos Carvalho MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <15893.50996.646711.184945@fisica.ufpr.br> Date: Fri, 3 Jan 2003 15:24:04 -0200 To: zsh-users@sunsite.dk Subject: Re: aliases not getting expanded inside functions? In-Reply-To: <20030103164552.A28966@globnix.org> References: <15893.44217.393956.262362@fisica.ufpr.br> <20030103164552.A28966@globnix.org> X-Mailer: VM 7.07 under Emacs 19.34.1 Phil Pennock (Phil.Pennock@globnix.org) 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.