[olug] conditional $PATH

Tim & Alethea Larson thelarsons3 at cox.net
Sat Aug 6 17:01:03 UTC 2005


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?

Thanks,
Tim

-- 
Tim & Alethea
christtrek.org



More information about the OLUG mailing list