Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [FAQ] PATH surgery
- X-seq: zsh-users 15938
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: Helmut Jarausch <jarausch@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [FAQ] PATH surgery
- Date: Tue, 05 Apr 2011 11:04:47 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <1301992478.30839.0@numa-i> (Helmut Jarausch's message of "Tue, 05 Apr 2011 10:34:38 +0200")
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <1301992478.30839.0@numa-i>
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