From: Vin Shelton <acs@alumni.princeton.edu>
To: Borsenkow Andrej <Andrej.Borsenkow@mow.siemens.ru>
Cc: zsh-workers@sunsite.dk
Subject: Re: typeset -U within a function
Date: 10 Nov 2001 09:13:47 -0500 [thread overview]
Message-ID: <m2ofma7lyc.fsf@zion.rcn.com> (raw)
In-Reply-To: <3BECD576.7060900@mow.siemens.ru>
Borsenkow Andrej <Andrej.Borsenkow@mow.siemens.ru> 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
prev parent reply other threads:[~2001-11-10 14:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-10 2:29 Vin Shelton
2001-11-10 7:21 ` Borsenkow Andrej
2001-11-10 14:13 ` Vin Shelton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2ofma7lyc.fsf@zion.rcn.com \
--to=acs@alumni.princeton.edu \
--cc=Andrej.Borsenkow@mow.siemens.ru \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).