From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3066 invoked from network); 10 Nov 2001 14:11:56 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (?d/3MW0wJ9E8RyOPKv6AGY+Uvef8WdpR7?@203.24.36.3) by ns1.primenet.com.au with SMTP; 10 Nov 2001 14:11:56 -0000 Received: (qmail 4444 invoked from network); 10 Nov 2001 14:11:52 -0000 Received: from sunsite.dk (130.225.247.90) by proxy.melb.primenet.com.au with SMTP; 10 Nov 2001 14:11:52 -0000 Received: (qmail 13795 invoked by alias); 10 Nov 2001 14:11:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16234 Received: (qmail 13780 invoked from network); 10 Nov 2001 14:11:39 -0000 Sender: ethersoft@rcn.com To: Borsenkow Andrej Cc: zsh-workers@sunsite.dk Subject: Re: typeset -U within a function References: <3BECD576.7060900@mow.siemens.ru> From: Vin Shelton Organization: EtherSoft, Inc Date: 10 Nov 2001 09:13:47 -0500 In-Reply-To: <3BECD576.7060900@mow.siemens.ru> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Borsenkow Andrej writes: > Vin Shelton wrote: > > > From either zsh-4.0.4 or from the latest CVS sources, when I create a > > function like this: > > function bar { > > > typeset -U PATH > > PATH=/xxx:/yyy > > } > > and then run it, PATH is unchanged: > > > > > > > typeset -Ug PATH > > typeset -U creates local variable. > > -andrej Ahh - I see. Here's what the zshbuiltins man page has to say: A parameter is created for each name that does not already refer to one. When inside a function, a new parameter is created for every name (even those that already exist), and is unset again when the function completes. See `Local Parameters' in zshparam(1). The same rules apply to special shell parameters, which retain their special attributes when made local. Thanks, Andrej. - vin