Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: typeset -U within a function
- X-seq: zsh-workers 16234
- From: Vin Shelton <acs@xxxxxxxxxxxxxxxxxxxx>
- To: Borsenkow Andrej <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- Subject: Re: typeset -U within a function
- Date: 10 Nov 2001 09:13:47 -0500
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <3BECD576.7060900@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: EtherSoft, Inc
- References: <m2snbn73z0.fsf@xxxxxxxxxxxx> <3BECD576.7060900@xxxxxxxxxxxxxx>
- Sender: ethersoft@xxxxxxx
Borsenkow Andrej <Andrej.Borsenkow@xxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author