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

Re: [FAQ] PATH surgery



Helmut Jarausch wrote:
> what's the simplest way to do some surgery on the PATH environment 
> variable. While vared is interactive I'll need to
>
> - split / join the PATH into an array of PATH's components
> - remove the first or any given component
> - search for a component containing a given string

$path is an array that's tied to $PATH. So basically, the splitting is
done for you already. The two parameters are updated with the other.

You could remove entries like this:

path[1]=()
path[-1]=()

or even

path[(re)/home/foo/bin]=()

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925



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