Gentoo Archives: gentoo-user

From: Richard Fish <bigfish@××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Environment variables don't export from within scripts
Date: Mon, 02 Jan 2006 21:52:39
Message-Id: 7573e9640601021348m6ba1994bq1084b5a540c7ab8a@mail.gmail.com
In Reply to: [gentoo-user] Environment variables don't export from within scripts by Kris Kerwin
1 On 1/2/06, Kris Kerwin <kkerwin@×××××××××.com> wrote:
2 > Hi all,
3 >
4 > I'm having difficulties exporting environment variables from within
5 > scripts. The problem doesn't seem to occur when exporting variables
6 > from the command line.
7 >
8 > To reiterate with an example,
9 >
10 > # export VARIABLE='test'
11 > # echo $VARIABLE
12 >
13 > works. However,
14 >
15 > # echo "export VARIABLE='test'" >> test_script
16 > # chmod 754 test_script
17 > # ./test_script
18 > # echo $VARIABLE
19
20 On Linux/Unix, environment variables a passed from parent processes to
21 children, never the other way around. This is unlike windows where
22 environment variables are shared by all processes.
23
24 So this is the expected and correct behavior, and thus, not a bug.
25
26 -Richard
27
28 --
29 gentoo-user@g.o mailing list