Environment variables. Where are they saved in?
Environment variables are stored in memory associated with a process.
Every process has access to its own set of environment variables. A child process (one started by the "current" process) inherits a copy of those variables. It's not possible for any process to alter any other process's environment variables.
Using a shell such as bash
you can define environment variables when you log in, or start a new bash
process. The shell itself also defines a number of environment variables (PWD
springs to mind, after being prompted by comments), and other environment variables, such as PATH
, are used at a much deeper level that just the shell
- in this example by the system libraries.