| |||||||||
Environment variables are a set of dynamic values that can affect the way running processes will behave.
In most Unix shells, each process has its own private set of environment variables that most likely were copies of the environment variables of the parent process. All Unix operating system flavors and DOS and Microsoft Windows have environment variables, however they do not all use the same variable names. Examples of environment variables include
Environment variables are also used to pass configuration information to running programs, e.g., in unix,
Shell scripts and batch files use environment variables to store temporary values for reference later in the script, and also to communicate data and preferences to child processes.
In unix, an environment variable that is changed in a script or compiled program will only affect that process and possibly child processes. The parent process and any unrelated processes will not be affected. In Windows, environment variables are stored globally in the windows registry, and changes are seen by all processes that see the relevant registry changes.