zsh-workers
 help / color / mirror / code / Atom feed
* typeset -U within a function
@ 2001-11-10  2:29 Vin Shelton
  2001-11-10  7:21 ` Borsenkow Andrej
  0 siblings, 1 reply; 3+ messages in thread
From: Vin Shelton @ 2001-11-10  2:29 UTC (permalink / raw)
  To: zsh-workers

>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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-11-10 14:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-10  2:29 typeset -U within a function Vin Shelton
2001-11-10  7:21 ` Borsenkow Andrej
2001-11-10 14:13   ` Vin Shelton

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).