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

Re: PWD parameter



On May 24, 12:38pm, Zoltan Hidvegi wrote:
} Subject: Re: PWD parameter
}
} Note that PWD can be unset even without my patch after typeset +r PWD.

Hmm, and it doesn't become set again upon "cd".  That, at least, I'd say
is (was) a bug, though I suppose it might be useful in some rare cases.

} And right now you can unset any writable special parameters.

I don't really have a problem with that, in the general case.

} It is always good to reduce the number of special parameters, since they
} are more complicated to handle in various places

I'd definitely agree that we shouldn't be *increasing* the number of special
paramters.  Do the ones that are already there very often need handling that
they don't already get?

} and sometimes special
} parameters behave differently from non-special parameters.

Chuckle.  Well, yes; I imagine that's why they're called "special".

} Looks like you'd like to ignore any changes to PWD, or at least when you
} assign it you'd like to check that the assigned value is correct.

The latter, but I wouldn't go so far in defining "correct" as to require
that `cd $PWD` and `cd ~+` put you in the same place -- just that both
ought to succeed.

This is probably wandering farther into philosophy than it's worth ....

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

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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