On Monday 02 January 2006 22:35, Kris Kerwin wrote:

> works. However,
>
>       # echo "export VARIABLE='test'" >> test_script
>       # chmod 754 test_script
>       # ./test_script
>       # echo $VARIABLE
>
> does not work. I've also tried the above while omitting the 'export'
> command, to the same effect. I'm using bash as my shell. I figured
> that I would try the same with sh instead, but still nothing.

This cannot work. Scripts cannot export back variables to their parent 
shell, but only to their children.

Read the first note here:

http://www.tldp.org/LDP/abs/html/othertypesv.html

The following will work:

# export VARIABLE='test'
# echo '#!/bin/bash' > test_script
# echo "echo $VARIABLE" >> test_script
# chmod 754 test_script
# ./test_script        # writes 'test'
-- 
[email protected] mailing list

Reply via email to