If I type into a terminal,
export DISPLAY=:0.0
... where is the shell storing that environment variable?
I'm using Ubuntu 8.10. I've looked in the files ~/.profile and /etc/profile and can find no trace of DISPLAY.
If I type into a terminal,
export DISPLAY=:0.0
... where is the shell storing that environment variable?
I'm using Ubuntu 8.10. I've looked in the files ~/.profile and /etc/profile and can find no trace of DISPLAY.
Type "set" and you will get a list of all the current variables. If you want something to persist put it in ~/.bashrc or ~/.bash_profile (if you're using bash)
That variable isn't stored in some script. It's simply set by the X server scripts. You can check the environment variables currently set using set.
It's stored in the process (shell) and since you've exported it, any processes that process spawns.
Doing the above doesn't store it anywhere in the filesystem like /etc/profile. You have to put it there explicitly for that to happen.
The kernel stores the list of environment variables and their values for each process, and inherit them to child processes. They exist at runtime, and are not stored in some file or so. But there is a virtual file in
/proc/<pid>/environ
Which contains all the environment variables. The kernel makes them visible by that virtual file. One can list them. For example to view the variables of process 3940, one can do
cat /proc/3940/environ | tr '\0' '\n'
Each variable is delimited by a binary zero from the next one. tr replaces the zero into a newline.
There is a very good explanation of all that at https://help.ubuntu.com/community/EnvironmentVariables
here is a simple tutorial on the subject I thought I should share with you guys http://www.geeksww.com/tutorials/operating_systems/linux/tips_and_tricks/working_bash_environment_variables_beginners_linux.php