I open tow terminal windows in my linux OS. In one window, I type the command
export a=10
but in another window, I enter
echo
When you export an environmental variable, the child processes of the shell (e.g.: the commands executed by the shell) do obtain a copy of that exported variable.
Shells running in two different terminals/windows do not fulfill this relationship in terms of processes.
If you want to set an environmental variable, so that every running shell will obtain a its own instance of the variable, consider defining it in .bashrc
(assuming you are using bash
). However, you won't be able to use this variable as a one "being shared" by all the running shells (each shell has its own copy of the variable).