Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: Set parent env with csh script Message-ID: <820@auspex.UUCP> Date: 9 Jan 89 19:14:47 GMT References: <174@v7fs1.UUCP> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 17 >Is it possible for a subshell to changes the calling shell's >environment? Only if you can convince the calling shell to somehow take requests that it change its environment from the subshell (there are no built-in mechanisms in the C shell for this, so you'd have to play games with some script reading input from the child shell and using "eval" or somesuch to set its environment. UNIX processes do not have the ability to modify their parent shell's environment (in the UNIX sense of "environment"). If your script just sets some environment variables, you might want to consider running it with the "source" command (C shell) or the "." command (Bourne/Korn shell); this causes the commands in the script to be executed in the *same* process, rather than in a child process. You might be able to use aliases to syntactically sugar-coat this, if desired....