0

I note that if I have several terminal windows opened and in one of them I set path variable through bashrc:

export APP_PATH="path_to_app"    
export PATH="$APP_PATH:$PATH"

Then call:

source ~/.bashrc

Then new path is visible only in that window where I did it. Why? How can I make it visible to others?

More of that if I call source several times all of the path entries are duplicated. Again why? I thought source just reloads all information for bashrc.

1

When you call source ~/.bashrc you reload your ~/.bashrc configuration only for that current terminal session. You have to do it for all other existing terminal sessions as well if you want to reload your ~/.bashrc

  • And what about the whole system? – Long Smith Apr 22 '16 at 11:27
  • If you open a new terminal it will read from the ~/.bashrc configuration file. Do mind that bashrc is a user dependet file. If you for example open up a terminal as root you will load your bashrc from /root/.bashrc. – Markus Lindberg Apr 22 '16 at 11:32

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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