Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have added a particular path to PATH and I am able to see that it has been added when I echo it, but when I echo $PATH in another window I cannot see that path I recently added. I am not sure why I am not able to see it there?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Environment variables don't escape the shell they're set in. So unless you add it to your ~/.bashrc, no other terminals will see the extra entry in $PATH

share|improve this answer
    
how can I add it to my ~/.bashrc? –  Sam007 Nov 16 '12 at 20:48
    
gedit ~/.bashrc and add a line export VARIABLE-NAME=VALUE –  Mowgli Nov 16 '12 at 20:55
    
Got it thanks. and I also need to source ~/.bashrc which I was missing out –  Sam007 Nov 16 '12 at 20:55
    
I don't think you need source ~/.bashrc, as bashrc is executed by default. –  Mowgli Nov 16 '12 at 20:56
    
Nope had to source it and it worked. Was not working without it –  Sam007 Nov 16 '12 at 20:57
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.