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

Re: Setting $path variable



> Is this supposed to happen:
> 
> Mycomputer % echo $path
> /bin /usr/bin /usr/local/bin
> Mycomputer % echo $PATH
> /bin:/usr/bin:/usr/local/bin
> Mycomputer % path=$path
> Mycomputer % echo $path
> /bin /usr/bin /usr/local/bin
> Mycomputer % echo $PATH
> /bin /usr/bin /usr/local/bin
> 
> So $PATH variable gets mangled. Adding something to the end of $path
> (by path=($path /usr/X11/bin) does not have this effect.

Yes, I think this is a feature, not a bug.  You should say
"path=($path)" if you want to keep path as an array.  Perhaps arrayness
should be more first-class than this, to be intuitive (so to get rid of
arrayness you'd type 'path="$path"' or something), but the current
behaviour doesn't seem too bad, IMHO.



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