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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1251
    Aakanksha
    Participant

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

    #9814
    Aakanksha
    Participant

    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. (The environment of the parent process can only be altered if the parent is explicitly set up to listen for some kind of change requests. The conventional execution of the BSD tset” program in .profile and .login files effects such a scheme.) Under MS-DOS, it’s possible to manipulate the master copy of the environment, but the required techniques are arcane.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.