Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer.They are part of the environment in which a process runs.
From PC DOS 2.0 in 1982, all succeeding Microsoft operating systems including Microsoft Windows, and OS/2 also have included them as a feature, although with somewhat different syntax, usage and standard variable names.In all Unix and Unix-like systems, each process has its own separate set of environment variables.By default, when a process is created, it inherits a duplicate environment of its parent process, except for explicit changes made by the parent when it creates the child.At the API level, these changes must be done between running notation.All Unix operating system flavors, DOS, and Windows have environment variables; however, they do not all use the same variable names.
A running program can access the values of environment variables for configuration purposes.
Examples of environment variables include: Shell scripts and batch files use environment variables to communicate data and preferences to child processes.
They can also be used to store temporary values for reference later in a shell script.
However, in Unix, other variables are usually used for this.
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.