Re: [NTLK] [OT] Unix gurus: help!

From: Andy Collins (acollins_at_newted.dyndns.org)
Date: Thu Aug 21 2003 - 06:52:30 PDT


Hi Laurent,

It looks like your running the C shell(?) and I've only done Borne, Korn
and Bash but try this anyway.

Try running the script by typing...
        . ./setEnv.tcsh

Note the leading dot and space. The dot means "run it in my shell space"
otherwise a new environment is started with its own memory and variable
space, the prog runs there and when it ends, the environment is closed.

With the leading dot space it run in you existing shell.

Cheers.

Andy.

On Thu, 21 Aug 2003 09:17:09 -0400, Laurent Daudelin
<laurent_daudelin_at_fanniemae.com> wrote:

> 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? That's on OS X 10.2.6, btw...
>
> Thanks for pointing my obvious stupid mistake...
>
> -Laurent.

-- 
This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries
List FAQ/Etiquette/Terms: http://www.newtontalk.net/faq.html
Official Newton FAQ: http://www.chuma.org/newton/faq/


This archive was generated by hypermail 2.1.5 : Thu Aug 21 2003 - 08:00:00 PDT