zsh-users
 help / color / mirror / code / Atom feed
* [FAQ] PATH surgery
@ 2011-04-05  8:34 Helmut Jarausch
  2011-04-05  9:04 ` Frank Terbeck
  0 siblings, 1 reply; 2+ messages in thread
From: Helmut Jarausch @ 2011-04-05  8:34 UTC (permalink / raw)
  To: Zsh Users

Hi,

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

Many thanks for a hint,
Helmut.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [FAQ] PATH surgery
  2011-04-05  8:34 [FAQ] PATH surgery Helmut Jarausch
@ 2011-04-05  9:04 ` Frank Terbeck
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Terbeck @ 2011-04-05  9:04 UTC (permalink / raw)
  To: Helmut Jarausch; +Cc: Zsh Users

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-05  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-05  8:34 [FAQ] PATH surgery Helmut Jarausch
2011-04-05  9:04 ` Frank Terbeck

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).