How to add a new path to a global .bashrc?
My account's .bashrc is linked to a global bashrc I guess by following code:
"if [ -f /etc/bashrc ]; then . /etc/bashrc fi" This is the only thing in my .bashrc, and tried to add a new path to it by adding PATH=/new/path:/another/new/path. But this caused my bash path to be lost. I couldn't run any basic command after that. How can I add a new path to my .bashrc? |
Have you used the export statement? It should be something like:
Code:
export PATH="/new/path:/another/new/path:${PATH} Edit: I've just seen you've corrected your original post. Now it looks like the problem is that you did not included the original PATH in your statement. Look at my example and try to reproduce it exactly. It should work. Take in mind that you can always execute basic commands giving the full path on the command line. For example use: Code:
/bin/vi ~/.bashrc |
Huh! I solved it.
I added the default path "$PATH:" to the beginning of the new path. The new line must be like this: PATH=$PATH:/new-path:/another-new-path |
Thanks yeah it works!
|
Quote:
|
All times are GMT -5. The time now is 01:01 AM. |