From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15136 invoked from network); 3 Jan 2003 18:54:24 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 3 Jan 2003 18:54:24 -0000 Received: (qmail 26830 invoked by alias); 3 Jan 2003 18:54:09 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5648 Received: (qmail 26821 invoked from network); 3 Jan 2003 18:54:09 -0000 Date: Fri, 3 Jan 2003 18:54:07 +0000 To: Carlos Carvalho Cc: zsh-users@sunsite.dk Subject: Re: aliases not getting expanded inside functions? Message-ID: <20030103185407.GA11836@fysh.org> References: <15893.44217.393956.262362@fisica.ufpr.br> <20030103164552.A28966@globnix.org> <15893.50996.646711.184945@fisica.ufpr.br> <20030103184455.A5692@globnix.org> <15893.53780.524763.695176@fisica.ufpr.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15893.53780.524763.695176@fisica.ufpr.br> User-Agent: Mutt/1.3.28i From: Zefram Carlos Carvalho wrote: >The manual says "Recognize the same escape sequences as the print >builtin in string arguments to subsequent flags." So there should be a >relation. That's the "p" (*small* p) flag. Phil was demonstrating the "P" (*capital* P) parameter expansion flag, which zshexpn(1) describes thus: # P This forces the value of the parameter name to be # interpreted as a further parameter name, whose # value will be used where appropriate. If used with # a nested parameter or command substitution, the # result of that will be taken as a parameter name in # the same way. For example, if you have `foo=bar' # and `bar=baz', the strings ${(P)foo}, ${(P)${foo}}, # and ${(P)$(echo bar)} will be expanded to `baz'. To use this kind of parameter alias for setting, you can do % foo=bar bar=baz % echo ${(P)foo} baz % : ${(P)foo::=xxx} % echo ${(P)foo} xxx % echo $foo $bar bar xxx which also works where foo is an array reference such as "array[3]". -zefram