[olug] conditional $PATH

Vincent Raffensberger Vincent.Raffensberger at dtn.com
Sat Aug 6 19:27:35 UTC 2005

I keep a script of common functions and source it from at the beginning of scripts.
Here's an example to get you started:


-----Original Message-----
From: olug-bounces at olug.org on behalf of Tim & Alethea Larson
Sent: Sat 8/6/2005 10:01 AM
To: Omaha Linux User Group
Subject: Re: [olug] conditional $PATH
Vincent Raffensberger wrote:
> "After" is just an optional argument to make it add the path to the end
> rather than the beginning of the variable.
> This would add it to the end:
> pathmunge /some/path after

Ah, gotcha.  The $1 and $2 were referring to arguments, not matches in 
the regex.

> BTW, this function is straight from a redhat's /etc/profile script.
> It's handy and helps keep your PATH variable from having many duplicates
> in it.

Is it possible to define pathmunge() once and then include it into many 
shell scripts?


Tim & Alethea
OLUG mailing list
OLUG at olug.org

More information about the OLUG mailing list