Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Feature / Idea / (a possible option)
- X-seq: zsh-workers 4215
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxxxxxxx>
- To: stucki@xxxxxxxxxxxxxxxxx
- Subject: Re: Feature / Idea / (a possible option)
- Date: Wed, 8 Jul 1998 14:14:13 -0500 (CDT)
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <Pine.GSO.3.95q.980708200939.6079L-100000@petzval> from "C. v. Stuckrad" at "Jul 8, 98 08:19:28 pm"
> We use a little Program called 'dotpath', to cleanup PATHes like
> export PATH=$(dotpath)
> where 'dotpath' prints the Path cleaned up from duplicate entries
> puts the '.' directory at the end (in case of 'root' accounts
> or 'wheel' group it even eliminates the '.').
How about typeset -U path PATH? That makes the path unique. Every
assignment after that will keep the path unique, so PATH=$PATH:$PATH
will leave the path unchanged. To move the dot to the end, do
path=( "${path[@]:#.}" . )
To remove the dot, you can do:
path[(r).]=()
Zoli
Messages sorted by:
Reverse Date,
Date,
Thread,
Author