On Thu, Aug 21, 2003 at 09:16:08AM -0400, Laurent Daudelin wrote:
: 
: I've been working on Nexstep/Openstep since 1992, so I know a bit of Unix.
: Right now, I'm trying to run a shell script from the terminal to set a few
: environment variables. Problem is, no matter what I do, the variables are
: undefined after I ran the script. I have a text file named 'setEnv.tcsh'
: like this:
: 
: #!/bin/tcsh -f
: setenv FOO "bar"
: echo -n 'Foo is "'
: echo -n $FOO
: echo '".'
: 
: I run it from the terminal like ./setEnv.tcsh. It runs and displays the
: value of FOO as 'Foo is "bar"', but whenever the script completes and I
: check the value of ${FOO}, I get undefined variable.

Running the shell script (tcsh? ick) like that executes everything in a
separate child process.  Changes like modifying environment variables in
a child process do not propogate back up to the parent process.

To make those changes stick in the current process, you need to source it:

        % source setEnv.tcsh


-- 
Eugene Lee

-- 
G-Books is sponsored by <http://lowendmac.com/> and...

 Small Dog Electronics    http://www.smalldog.com  | Refurbished Drives |
 -- Check our web site for refurbished PowerBooks  |  & CDRWs on Sale!  |

      Support Low End Mac <http://lowendmac.com/lists/support.html>

G-Books list info:      <http://lowendmac.com/lists/g-books.html>
  --> AOL users, remove "mailto:";
Send list messages to:  <mailto:[EMAIL PROTECTED]>
To unsubscribe, email:  <mailto:[EMAIL PROTECTED]>
For digest mode, email: <mailto:[EMAIL PROTECTED]>
Subscription questions: <mailto:[EMAIL PROTECTED]>
Archive: <http://www.mail-archive.com/g-books%40mail.maclaunch.com/>



---------------------------------------------------------------
>The Think Different Store
http://www.ThinkDifferentStore.com
---------------------------------------------------------------


Reply via email to