Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PWD parameter



> } This is exacly how zsh behaves after typeset +r PWD.
> 
> Not quite.  For example, my $HOME is /home/schaefer, but that's really a
> symlink to /extra/home/schaefer.  In zsh 3.0.5, if I do
> 
> 	cd $HOME
> 	typeset +r PWD
> 	unset PWD
> 	PWD=/extra/home/schaefer
> 	echo $PWD
> 
> then what I get back is /home/schaefer.  *That* seems a bit odd.

PWD has nullsetfn as the write function.  Since PWD is special, unset
just sets a flag in the Param node, it does not really unset anything.
The PWD=... assignment clears this flag, restoring the old value of PWD.
The assigned value is lost.

Zoltan



Messages sorted by: Reverse Date, Date, Thread, Author