Environment Variables (1/2)
The terms environment and environment variables are used in a lot of slightly different contexts. Giving a universal definition is therefore difficult. We give a possible definition below and also point the reader to other definitions.
Environment variables are a mechanism to exchange information between a program and the system on which it is running. The system will associate an environment (i.e. a list of environment variables) with each program on the system. The program can then get the values of the variables defined in the associated environment. It can also update existing variables and create new ones.
Environment variables are best used to store information that is unlikely to change very often. Command line arguments would typically be used for information that changes often.
- Wikipedia: Environment Variable
- TechTarget's definition of an environment variable
- The GNU C Programming Tutorial
- The Linux Tutorial