Page 1 of 1

Environmental variables

Posted: Sat Feb 17, 2007 6:46 pm
by Beach
I can set a environment variable in my current bash session with the "export" command, however, this variable does not show up in other bash sessions. Is there anyway to set a variable globally? I would like to be able to monitor something that has changed in memory rather than in a file - which would cause more IO than I was hoping for.

Posted: Sat Feb 17, 2007 7:08 pm
by walker
Edit the .bashrc in your homedir (it's a dot file)
simply write your exports at the end of the file...

Posted: Sat Feb 17, 2007 7:27 pm
by Beach
Thanks for the reply. I thought about that, and also to edit the "/etc/bash.bashrc" file that should make a variable global. I was hoping not to have to touch any of the users files. I am working on a different approach now, I was just wondering if I could set it globally for all users who are currently logged in.