[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: remove paths
From: |
Sven Mascheck |
Subject: |
Re: remove paths |
Date: |
20 Jul 2001 20:46:00 +0200 |
User-agent: |
tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u)) |
Padraig Brady <Padraig@linux.ie> wrote:
>>>How do you remove a directory path from the $PATH variable?
> newpath=`echo $PATH | tr : '\n' | uniq | tr '\n' :`
uniq(1) expects sort(1)ed output, you also could use "sort -u",
but usually that's really not what you want...
Sometimes it's even rather attractive not to fork several time, but
to use only built-in stuff for reasons of speed or alike. Especially,
if you are changing a lot in the environment, probably depending on
the platform (in NFS).