From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14850 invoked from network); 3 Jan 2003 18:10:45 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 3 Jan 2003 18:10:45 -0000 Received: (qmail 843 invoked by alias); 3 Jan 2003 18:10:33 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5647 Received: (qmail 834 invoked from network); 3 Jan 2003 18:10:32 -0000 From: Carlos Carvalho MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <15893.53780.524763.695176@fisica.ufpr.br> Date: Fri, 3 Jan 2003 16:10:28 -0200 To: zsh-users@sunsite.dk Subject: Re: aliases not getting expanded inside functions? In-Reply-To: <20030103184455.A5692@globnix.org> References: <15893.44217.393956.262362@fisica.ufpr.br> <20030103164552.A28966@globnix.org> <15893.50996.646711.184945@fisica.ufpr.br> <20030103184455.A5692@globnix.org> X-Mailer: VM 7.07 under Emacs 19.34.1 Phil Pennock (Phil.Pennock@globnix.org) wrote on 3 January 2003 18:44: >print is merely what was used for showing the results. The variable >substitution does not rely upon print. I agree, I just used print as an example of reading the value, not setting it. >% set -A array alpha beta gamma delta epsilon zeta >% guess_what='array[3]' >% echo ${(P)guess_what} >gamma >% guess_what='array[4]' >% echo ${(P)guess_what} >delta It doesn't work if you try to do guess_what=foobar, meaning array[4]=foobar. >% guess_what='array[1]' >% for i in $(perl -le "print foreach split //, '${(P)guess_what}'") ; echo $i >a >l >p >h >a >% Nice :-) I should have learned perl long since. In fact probably the script I'm doing should be written in perl... >I think that you're confusing "print -P", which recognises the same >escape sequences as are used in prompt substitution, with the parameter >expansion flag 'P', which is described in zshexpn(1). The manual says "Recognize the same escape sequences as the print builtin in string arguments to subsequent flags." So there should be a relation.