I am basically using .bashrc for adding environment variables. Each time I add a new Environment variable, I have to log out the current session and log in again to bring the changes in effect.
Is there any way where I can add environment variable and continue working without restarting the session ?
[I think I am clear with my question. If more information is needed, please let me know]
Any help is highly appreciated. :)
(Ubuntu 14.04 - 32-bit)
2 Answers
Try source ~/.bashrc, or . ~/.bashrc. Both are the same in bash, and will update you ENV variables.
Example:
export $FOO=bar
echo $FOO
bar
echo "FOO=test" >> ~/.bashrc
. ~/.bashrc
echo $FOO
test 1 If they are terminal releated (like archey or alias commands etc) you can do exit. Else you need to relog.