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

Re: environment settings



On Tue, Jun 17, 2008 at 03:28:20PM +0200, Mikael Magnusson wrote:
> 2008/6/17 Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>:
> > Moreover, if you do
> >
> > path+=(/some/path)
> > in ~/.zshenv, you'll soon end up with /some/path dupplicated.
> 
> typeset -U path
[...]

Changing the type of $path in ~/.zshenv, that is for all zsh
shells (including script interpreters) that this user may run
seems dangerous to me.

Some scripts might expect $path[-1] to be the last component
that they added for instance.

Like:

path+=("$(some-cmd)") && print -ru2 just added $path[-1] to PATH

If something changed the type of $path behind its back, then the
above won't work correctly.

-- 
Stéphane



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