[Eug-lug] Shell scripts to export environment variables?
Ben Barrett
stircrazyben at gmail.com
Tue Feb 26 11:35:11 PST 2008
Right; fair discussion of this at
http://www.velocityreviews.com/forums/t352671-putenv.html
~ben
On Tue, Feb 26, 2008 at 11:25 AM, Mike Cherba <
mike.cherba at caviumnetworks.com> wrote:
> instead of invoking the script with #!/bin/bash try using "source
> scriptname" to run it within the current shell. the #!/binbash
> invokation spawns a subshell to run the script and the returns, blowing
> away any environment variables you might have set.
>
> -Mike
>
> "Counting in octal is just like counting in decimal, if you don't use
> your thumbs." --=97 Tom Lehrer.
>
>
> On Tue, 2008-02-26 at 11:16 -0800, Rob Hudson wrote:
> > I've got some Python scripts that rely on shell environment variables
> > for certain things. I wrote a simple script that did an export but it
> > didn't take, and I'm guessing that the shell script gets its own
> > environment, that when the script terminates goes away.
> >
> > Is there a way to write a shell script that can export an environment
> > variable to the calling shell?
> >
> > I know I can set environment variables in Python, but I want to keep
> > things modular so I can re-use the Python script and do things based
> > on different environment settings.
> >
> > Thanks,
> > Rob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://euglug.org/pipermail/euglug/attachments/20080226/6c7b6853/attac=
hment.htm
More information about the EUGLUG
mailing list