Leon Breedt wrote:

> hi
>
> 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?

Your programs gets executed in a subshell, so the environment changewill be
limited to you program only,
When the program exits, it returns to parent (shell), which has the old
environment
that is what you see.
in csh we use "source" to execute the program in current shell, but it works
with scripts only.
-Salil
-----

>
>
> thanks,
>
> leon
>
> --
>  Leon Breedt  |  Codewarrior :)  |  Debian 2.0  |  Linux 2.1.127
>  PGP key and homepage at http://ejb.www.icon.co.za
>
>  Linux:  Because I want to get there *today*


Reply via email to