how to remove a path from the default $PATH
Dear friends:
My system $PATH is : /usr/lib64/mpi/gcc/openmpi/bin:/home/ztdep/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit i want to delete the first "/usr/lib64/mpi/gcc/openmpi/bin" , since i need to install the mpich2.2 by myself Could you please give me some help. |
Depends on how it got added ...
Check the files/directories ... if it under /etc/profile.d/ just grep for the path. Cheers, Tink |
As Tinkster says, if you want to change it permanently, you need to track down the line where it's being set, and modify that.
But to remove an entry from the current PATH "on the fly", you can use a simple parameter substitution. Code:
del='/usr/lib64/mpi/gcc/openmpi/bin:' I use this technique in a small function that toggles the availability of a directory of scripts I only need to use occasionally (I don't like to have them generally available, as they clutter up some common tab completions). Code:
myscripts (){ |
Quote:
Thank you very much for your feedback. The path is the default PATH after i installed the opensuse 12.1. I have use the grep in the "/etc/profile /etc/profile.d/* and /.bashrc /.profile , it can not find anything. Could you please give me futher instruction. Regards |
Code:
grep PATH /etc/profile /etc/profile.d/* ~/.bashrc ~/.bash_login ~/.bash_profile ~/.profile |
Quote:
Code:
find /etc -type f -exec grep -H /usr/lib64/mpi/gcc/openmpi/bin {} \; Cheers, Tink |
All times are GMT -5. The time now is 04:09 PM. |