Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site talcott.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!tmb From: tmb@talcott.UUCP (Thomas M. Breuel) Newsgroups: net.lang.c,net.unix Subject: Re: setenv from c Message-ID: <514@talcott.UUCP> Date: Sun, 22-Sep-85 12:50:36 EDT Article-I.D.: talcott.514 Posted: Sun Sep 22 12:50:36 1985 Date-Received: Mon, 23-Sep-85 02:59:46 EDT References: <2936@ncsu.UUCP> Organization: Harvard University Lines: 21 Xref: watmath net.lang.c:6509 net.unix:5711 In article <2936@ncsu.UUCP>, rlj@ncsu.UUCP (Rick Johnson) writes: > Is it possible to set a csh environment variable within a C program? I know > about getenv(), but have failed at attempts to set an environment variable > from a C program. Basically, what I want to do is "source" a new environment > variable for the current csh process. Any comments or suggestions would be > appreciated. Thanks. [I have heard this question before several times, and think that a posting is therefore warranted. It belongs in net.unix.] [see also execve(2) and environ(7)] The environment strings reside in a process' address space, which makes them inaccessible to any other process. It is therefore not possible for one process to change the environment variables of another process except at the time of creation of an immediate child, when the environment is passed as the third argument to the execve system call (other varieties of the exec system call (implemented as library functions) pass the environment data along automatically). Thomas. Brought to you by Super Global Mega Corp .com