Bug#981171: [PATCH 08/13] Better documentation of the environment mechanism
Le jeudi 28 janvier 2021, 10:51:08 UTC Michael Kerrisk (man-pages) a écrit : > On 1/27/21 4:48 PM, roucaries.bast...@gmail.com wrote: > > From: Bastien Roucariès > > > > Compare with argc/argv > > Why? The commit message should explain why you think this > change is useful. Ok. Here, I want to improve description for a newbie of the linux environment variable . It improve the man page by giving some context, and define an environment variable. It give the why Will improve patch description Bastien > > Thanks, > > Michael > > > and describe the purpose of environment > > --- > > > > man7/environ.7 | 24 > > 1 file changed, 24 insertions(+) > > > > diff --git a/man7/environ.7 b/man7/environ.7 > > index 7eeb1fe0e..f9e49a572 100644 > > --- a/man7/environ.7 > > +++ b/man7/environ.7 > > @@ -66,6 +66,30 @@ if the > > > > feature test macro is defined (see > > .BR feature_test_macros(7)). > > .PP > > > > +At time of execution, a program receives context information by two > > mechanisms. +The first way is the program arguments, represented by the > > +.I argc > > +and > > +.I argv > > +arguments of the > > +.I main > > +function. The second is the > > +.I environ > > +variable as discussed in this manual. > > +.PP > > +The program arguments are typically used to pass so-called > > +command-line arguments specific to a particular use of the program > > +being invoked, thus changing the program's behavior for this 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 TMDIR > > +environment variable to discover a suitable location to store temporary > > files. +.PP > > +Standard environment variables are used for information about the user' > > home directory, +current language, etc., and a 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. signature.asc Description: This is a digitally signed message part.
Bug#981171: [PATCH 08/13] Better documentation of the environment mechanism
On 1/27/21 4:48 PM, roucaries.bast...@gmail.com wrote: > From: Bastien Roucariès > > Compare with argc/argv Why? The commit message should explain why you think this change is useful. Thanks, Michael > and describe the purpose of environment > --- > man7/environ.7 | 24 > 1 file changed, 24 insertions(+) > > diff --git a/man7/environ.7 b/man7/environ.7 > index 7eeb1fe0e..f9e49a572 100644 > --- a/man7/environ.7 > +++ b/man7/environ.7 > @@ -66,6 +66,30 @@ if the > feature test macro is defined (see > .BR feature_test_macros(7)). > .PP > +At time of execution, a program receives context information by two > mechanisms. > +The first way is the program arguments, represented by the > +.I argc > +and > +.I argv > +arguments of the > +.I main > +function. The second is the > +.I environ > +variable as discussed in this manual. > +.PP > +The program arguments are typically used to pass so-called > +command-line arguments specific to a particular use of the program > +being invoked, thus changing the program's behavior for this 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 TMDIR > +environment variable to discover a suitable location to store temporary > files. > +.PP > +Standard environment variables are used for information about the user' home > directory, > +current language, etc., and a 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. > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/
Bug#981171: [PATCH 08/13] Better documentation of the environment mechanism
From: Bastien Roucariès Compare with argc/argv and describe the purpose of environment --- man7/environ.7 | 24 1 file changed, 24 insertions(+) diff --git a/man7/environ.7 b/man7/environ.7 index 7eeb1fe0e..f9e49a572 100644 --- a/man7/environ.7 +++ b/man7/environ.7 @@ -66,6 +66,30 @@ if the feature test macro is defined (see .BR feature_test_macros(7)). .PP +At time of execution, a program receives context information by two mechanisms. +The first way is the program arguments, represented by the +.I argc +and +.I argv +arguments of the +.I main +function. The second is the +.I environ +variable as discussed in this manual. +.PP +The program arguments are typically used to pass so-called +command-line arguments specific to a particular use of the program +being invoked, thus changing the program's behavior for this 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 TMDIR +environment variable to discover a suitable location to store temporary files. +.PP +Standard environment variables are used for information about the user' home directory, +current language, etc., and a 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. -- 2.29.2