2 cases of exporting Environment Variable
Run these commands on a terminal:
$ export x=hello
$ xterm & # this is xterm 1. "echo $x" we have hello
$ x=$x' add more here'
$ xterm & # this is xterm 2. "echo $x" we have "hello add more here"
So, it means I don't have to export the variable x a second time. The same holds for PATH env var. However, the following situation is different:
$ PS1="\T; \j jobs> "
$ xterm & # the bash prompt was the default (not change).
In this case, I have to export PS1 for it to work. In my opinion, I think PS1 is an environment variable, so it was exported already at start up. Thus, I don't have to export it a second time when I changed its value.
Can anyone help me to explain this? Thanks a bundle.
Last edited by echipbk; 02-05-2013 at 05:30 AM.