Laurent Daudelin writes:
> Sorry for the off-topic message. I could really use some help! I've been
> banging my head over a stupid problem I'm experiencing on OS X and can't
> waste anymore time. If I can't resolve this quickly, I will have to jump on
> by Windoze box.
>
> 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.
>
> What's going on?
>
> Thanks for pointing my obvious stupid mistake...
Executing a script means that it runs in its own shell - any
changes to variables etc will not be reflected in the parent shell.
What you should do instead is to "include" the file; you do
this by
source setEnv.tcsh
HTH.
--
Raymond Wiker Mail: [EMAIL PROTECTED]
Senior Software Engineer Web: http://www.fast.no/
Fast Search & Transfer ASA Phone: +47 23 01 11 60
P.O. Box 1677 Vika Fax: +47 35 54 87 99
NO-0120 Oslo, NORWAY Mob: +47 48 01 11 60
Try FAST Search: http://alltheweb.com/
--
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
---------------------------------------------------------------