Re: Environment Variable - Parent Process --- TIA
From: Keith Thompson (kst-u_at_mib.org)
Date: 02/07/05
- Next message: CBFalconer: "Re: [OT] Google-groups indentation problem fixed!!!!"
- Previous message: Lawrence Kirby: "Re: Environment Variable - Parent Process --- TIA"
- In reply to: glen herrmannsfeldt: "Re: Environment Variable - Parent Process --- TIA"
- Next in thread: Michael Mair: "Re: Environment Variable - Parent Process --- TIA"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 07 Feb 2005 19:24:48 GMT
glen herrmannsfeldt <gah@ugcs.caltech.edu> writes:
>>> Jimmy Cracker wrote:
>>>
>>>> Is it completely impossible in UNIX to push an environment variable to
>>>> the parent shell? I would like to do something like this: [...]
>
> It is possible in unix, but not in C.
>
> See the tset command, and the X11 resize command.
<OT>
Those commands are examples of ways a parent process can set its own
environment variables based in information from a child process. They
do not illustrate propagating an environment variable directly to a
parent process, which is generally not possible in Unix.
</OT>
The only facility C provides is the getenv() function, whose behavior
is almost entirely system-specific. It allows querying a specific
environment variable; there's no portable way either to set a variable
or to get a list of all environment variables. A conforming C
implementation could be perfectly happy on a system on which child
processes can propagate environment variables to their parents, or
even to unrelated processes. The C standard says nothing about
processes at all.
-- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst> We must do something. This is something. Therefore, we must do this.
- Next message: CBFalconer: "Re: [OT] Google-groups indentation problem fixed!!!!"
- Previous message: Lawrence Kirby: "Re: Environment Variable - Parent Process --- TIA"
- In reply to: glen herrmannsfeldt: "Re: Environment Variable - Parent Process --- TIA"
- Next in thread: Michael Mair: "Re: Environment Variable - Parent Process --- TIA"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|