({{, (RefLink[ProcessEnvironment, paclet:ref/ProcessEnvironment]) 
is an option specifying the initial settings of environment variables to use when executing a process in functions like (RefLink[StartProcess, paclet:ref/StartProcess]) and (RefLink[RunProcess, paclet:ref/RunProcess]).}})

OpenersNotesSection(Spacer1)Details

With the default setting (RefLink[ProcessEnvironment, paclet:ref/ProcessEnvironment])->(RefLink[Inherited, paclet:ref/Inherited]), the subprocess will inherit its initial directory from the environment settings of the parent process (the Wolfram Engine) that calls it.

The values of environment variables are typically given in an association.

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

On Unix systems like Mac OS and Linux, these inputs run the echo process from a system shell to report the value of the environment variable set by the value of the (RefLink[ProcessEnvironment, paclet:ref/ProcessEnvironment]) option:

RunProcess[$SystemShell,"StandardOutput","echo $VAR",ProcessEnvironment-><|"VAR"->"valueOfVAR"|>]

RunProcess[{$SystemShell,"-c","echo $VAR"},"StandardOutput",ProcessEnvironment-><|"VAR"->"valueOfVAR"|>]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Environment, paclet:ref/Environment])  ▪  (RefLink[SetEnvironment, paclet:ref/SetEnvironment])  ▪  (RefLink[ProcessDirectory, paclet:ref/ProcessDirectory])}})}})