Environment Variables
Description
Environment variables are name-value pairs that can be used to communicate information from a process to its descendants. They are typically used to provide programs with information about the environment in which they are executing (hence the name). Notable ones include:
DISPLAY |
the local or remote X Window display that should be used by default |
PATH |
the list of paths to search when looking for an executable |
PWD |
the current working directory |
TERM |
the terminal type |
TZ |
the default timezone |
Environment variables are inherited from parent to child when new processes are created. Processes can freely alter their own environment variables but not those of other processes. In particular, changes made by a child process do not propagate back to its parent.
microHOWTOs
- Add a directory to the current path
- Display the value of an environment variable
- Persistently set the value of an environment variable for a given user
- Persistently set the value of an environment variable for all users
- Set the value of an environment variable
Further reading
- Environment Variables, Base Specifications, Issue 7, The Open Group, 2008
- EnvironmentVariables, Community Ubuntu Documentation
- environ(7) (Linux manpage)