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

Re: Builtin append() and prepend() to PATH, CDPATH, etc.



> For example, zsh has `pushd_ignore_dups'.  I think it would be easy
> to add a builtin function, say, `uniq-var' that, like `export', accept
> a variable list of arguments.  An example is
> 	$ uniq-var PATH CDPATH MANPATH

>From zsh-2.6-beta17 you can use typeset -U path cdpath manpath which does
exactly what you want.

> After evaluating this statement, modifying any of the 3 variables
> would ensure no duplication:
> 	$ set path = (/usr/local/bin $path /usr/bin)

This is the csh syntax.  In zsh you have to write

$ path=(/usr/local/bin $path /usr/bin)

Zoltan




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