Ah, OK then...
-Original Message-
From: Gordon Messmer [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 1:32 PM
To: [EMAIL PROTECTED]
Subject: RE: How to modify evironment variables in a C program
On Mon, 2002-03-11 at 09:53, Burke, Thomas G. wrote:
> I would try usin
On Mon, 2002-03-11 at 09:53, Burke, Thomas G. wrote:
> I would try using a system call in the C program.
>
> try
>
> ...
> system("setenv foo bar");
> ...
The system call is not passed on to the parent shell, it's run in a
sub-shell.
I don't believe it's at all possible to call setenv in a sys
eery" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, March 09, 2002 3:12 AM
> Subject: Re: How to modify evironment variables in a C program
>
> >
> > As designed. If any child program could alter the values of the
> environment
>
I would try using a system call in the C program.
try
...
system("setenv foo bar");
...
-Original Message-
From: Xanh [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 12:49 PM
To: [EMAIL PROTECTED]
Subject: Re: How to modify evironment variables in a C program
Tha
March 09, 2002 3:12 AM
Subject: Re: How to modify evironment variables in a C program
>
> As designed. If any child program could alter the values of the
environment
> setting in their parent process, chaos could ensue. Imagine for a moment
that
> I convince you to play my game ca
Xanh wrote:
> How do I export a change to an environment variable made in a C program?
> $>export MyTest="Current Value"
> $>./testenv
> current value: Current Value
> new value: New value here
> $>echo $MyTest
> Current Value
>
> The old value is retained.
As designed. If any child
On Fri, Mar 08, 2002 at 06:23:15PM -0600, Xanh wrote:
> Hello,
> How do I export a change to an environment variable made in a C program?
> I tried setenv() and putenv(), but the change is not visible to the shell.
>
> // testenv.c
> int main(int argc, char* argv[], char* envp[])
> {
>
First thing I would do is check the return of p on the second call to
getenv()
___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list