Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!asuvax!noao!amethyst!raw From: raw@math.arizona.edu (Rich Walters) Newsgroups: comp.lang.c Subject: Re: Sticky IBM C programming problems (summary of replies) Message-ID: <1477@amethyst.math.arizona.edu> Date: 1 Mar 90 23:25:09 GMT References: <90055.142524CMH117@psuvm.psu.edu> <9003012109.AA07700@ei.ecn.purdue.edu> Sender: news@amethyst.math.arizona.edu Organization: Dept. of Math., Univ. of Arizona, Tucson AZ 85721 Lines: 24 In article <9003012109.AA07700@ei.ecn.purdue.edu> tlmfe@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 this is in a UNIX machine: The program is run in a separate shell unless you explicitly run it in the current shell (not recommened.) Thus the program only 'sees' the envirion- ment variables that are explicitly EXPORTED from your login shell. I am fairly sure that this is correct for the bourne shell and the korn shell. I don't know about the c shell. Richard Walter ------------------------------------------------------------------------------- Keep on crunching those numbers -------------------------------------------------------------------------------