[PATCH 08/14] Better documentation of the environment mechanism
[email protected] Mon, 25 Jan 2021 10:40:33 +0000
| Newsgroups | gmane.linux.debian.internationalization.english |
|---|---|
| Message-ID | <[email protected]> |
From: Bastien Roucariès <[email protected]> Compare with argc/argv and describe the purpose of environment --- man7/environ.7 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/man7/environ.7 b/man7/environ.7 index bba4f93cb..2fdb63d68 100644 --- a/man7/environ.7 +++ b/man7/environ.7 @@ -66,6 +66,29 @@ if the feature test macro is defined (see .BR feature_test_macros(7)). .PP +At time of execution, a program receive context information by two mechanisms. The first way is +the program arguments, represented by the arguments of +.I main +function, +.I argc +and +.I argv +variables. The second way, is the +.I environ +variable as discuted in this manual. +.PP +The program arguments are typically used to pass so-called command-line argument specific to +a particular use of the program being invoked, thus changing the program behavior to an use case. +The environment, on the other hand, keeps track of information that is shared by many programs and +rarely changes. For example, a running process can query the value of the +.B TEMP +environment variable to discover a suitable location to store temporary files. +.PP +Standard environment variables are used for information about the user’s home directory, +current language,... An user can define additional variables for other purposes. +The set of all environment variables that have values is collectively known as +the process environment or simply the environment. +.PP This array of strings is made available to the process by the .BR exec (3) call that started the process.