Sticky IBM C programming problems (summary of replies)

Henry Spencer henry at utzoo.uucp
Sat Mar 3 04:15:38 AEST 1990


In article <9003012109.AA07700 at ei.ecn.purdue.edu> tlmfe at EE.ECN.PURDUE.EDU (Mark B Strong) writes:
>Quick question:  Why won't an environmental variable I change within
>a C program stay after the program is terminated?  Setenv() doesn't seem
>to work?  

Assuming you are running on a Unix system...  The environment variables
your program gets are *copies* of those in its parent shell, and are in
the program's own address space.  There is no way for the program to
affect its parent's variables.
-- 
MSDOS, abbrev:  Maybe SomeDay |     Henry Spencer at U of Toronto Zoology
an Operating System.          | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list