On Wed, 11 Nov 1998 17:42:28 Leon Breedt wrote:
> i am dumbfounded as to why setenv() does nothing.
> this is the code fragment:
>
> setenv(env_name, new_value, 1);
>
> env_name's contents are 'TERM', and new_value contains 'vt100'. After
> running the program, however, I notice that TERM still contains the value
> 'linux'. Did I just change the value of term for the duration of my
> program? If so, how can I make the change permanent?
Try reading the manpages for fork and exec[v](2). When a process is created the
address space of the parent including enviroment strings is cloned. Any changes
that the child process makes are not visible to the parent unless the parent
uses the dot (.) operator or the child process explicitly exports changes.
If you invoke your program as follows you should get the result you want:
coolprompt> . proggy
Hope this solves the problem.
Regards,
David
--
David Ross
[EMAIL PROTECTED]
Toad Technologies
"I'll be good! I will, I will !"