On Thu, 5 Oct 2023 11:07:03 +0000, Seymour J Metz <[email protected]> wrote:
>Where do you think process initialization gets the variable names and values? > I believe: o If the process is initialized by init (often PID 0), init creates the environ array. o If the process is initialized by fork() the environ array is copied from the parent. o If one of the exec family of functions replaces the current process image, the environ array is copied from the envp[] argument. None of these require a shell. ________________________________________ From: Jon Perryman Sent: Wednesday, October 4, 2023 11:09 PM On Thu, 5 Oct 2023 02:37:57 +0000, Seymour J Metz wrote: >The shell creates the environment variables. No. The environment variable array is created by process initialization. The shell and programs can modify the array. I believe sub-shells in the same process use the same array. -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
