### Question 19.33

How can a process change an environment variable in its caller?

It may or may not be possible to do so at all. Different operating systems implement global name/value functionality similar to the Unix environment in different ways. Whether the ``environment'' can be usefully altered by a running program, and if so, how, is system-dependent.

Under Unix, a process can modify its own environment (some systems provide `setenv` or `putenv` functions for the purpose), and the modified environment is generally passed on to child processes, but it is not propagated back to the parent process.

Read sequentially: prev next up top

This page by Steve Summit // Copyright 1995 // mail feedback