Click to See Complete Forum and Search --> : editing the PATH


jon787
10-26-2002, 01:50 PM
On the network here the sysadmin added ./ to everyone's PATH. How would I go about removing that from my PATH? The path goes like:
/usr/local/gcc-3.1.1/bin: /usr/bin:/bin:.:/classes/cs1131/bin

And it varies whether I am on the Sun machines or the Red Hat machines. Is there anyway I could search the path for the ":." part break the path on each side and recombine it?

TacKat
10-26-2002, 02:29 PM
PATH=`echo "$PATH" | sed -e 's/:\.:/:/g' -e 's/:\.$//'`

Edit: Now replaces multiple :.: should they occur