Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
typeset -U within a function
- X-seq: zsh-workers 16232
- From: Vin Shelton <acs@xxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: typeset -U within a function
- Date: 09 Nov 2001 21:29:55 -0500
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: EtherSoft, Inc
- Sender: ethersoft@xxxxxxx
>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:
zion% /usr/local/zsh-4.0.4/bin/zsh -f
zion% function bar {
function> typeset -U PATH
function> PATH=/xxx:/yyy
function> }
zion% echo $PATH
/home/acs/bin:/usr/local/bin:/usr/X11R6/bin:/bin:/usr/bin:/etc
zion% bar
zion% echo $PATH
/home/acs/bin:/usr/local/bin:/usr/X11R6/bin:/bin:/usr/bin:/etc
If I remove the 'typeset -U PATH' line (even if PATH already had been
'typeset -U' before entering the function), the value of PATH is
changed by the function bar:
zion% function bar {
function> PATH=/xxx:/yyy
function> }
zion% echo $PATH
/home/acs/bin:/usr/local/bin:/usr/X11R6/bin:/bin:/usr/bin:/etc
zion% bar
zion% echo $PATH
/xxx:/yyy
- vin
Messages sorted by:
Reverse Date,
Date,
Thread,
Author