Setting environment variables for tcsh session

Dan Sommers me at privacy.net
Thu Jul 21 23:12:33 EDT 2005


On Thu, 21 Jul 2005 21:39:01 -0500,
David Durkee <ddurkee at gmail.com> wrote:


> I'm trying to write a script I can run from tcsh in Terminal (on Mac
> OS X) that will set environment variables that can be accessed by
> subsequent commands I execute in that session. Not having any luck so
> far. Here's what I've tried:

By design, you can't do that (think of the problems if arbitrary
programs could change your interactive shell's environment behind your
back).

Processes (your script) cannot change the environment of their parents
(your shell).  The best you can do is have your script output the right
commands and have your shell read them.  See "Command Substitution" in
the tcsh man page.

Regards,
Dan

-- 
Dan Sommers
<http://www.tombstonezero.net/dan/>



More information about the Python-list mailing list