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

Re: path/PATH function



[I'm reading from zsh-3.1.2, but I think this is the same in 3.0.5]

sweth@xxxxxxxxxxxxxxxxxxxx said:
> cdpath=(. .. ~)
> 	i hadn't declared $CDPATH anywhere in my .z* files, but echoing
> $CDPATH  after login returned
> 	 .:..:/home/sweth/sweth 

sweth@xxxxxxxxxxxxxxxxxxxx said:
> i'm assuming that this is some sort of zsh path-addition option, along
>  the lines of what i had created; i couldn't find any reference to it
> in the FAQ,  however, other than a note in the wish-list for users to
> "be able to create  their own foopath/FOOPATH array/path
> combinations."  does anyone know anything  more about this feature? 

Look at the zshparam manpage.  cdpath and CDPATH are linked in the same way as 
path and PATH.  typeset -U may also be relevant: it tells zsh to keep only the 
first element of identical copies, and comments that this also works with 
special variables like PATH and CDPATH.

Note that there's a typo in the description: should be "For arrays keep only 
the first element of each duplication.", not "...duplications".  I think, 
anyway, perhaps there's a better way to phrase it.




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