If at command line, in a sh shell I do:
It will display 100.
If I put first two lines in a script file a.sh and the last line in a script file b.sh and then I execute:
It echoes nothing.
Any idea why?
I've tried before setting VAR1 to do a:
and at the end to do a:
But still I cannot use/pass VAR1 in second script.
Code:
VAR1=100
export VAR1
echo $VAR1
It will display 100.
If I put first two lines in a script file a.sh and the last line in a script file b.sh and then I execute:
Code:
./a.sh
./b.sh
It echoes nothing.
Any idea why?
I've tried before setting VAR1 to do a:
Code:
set -e
and at the end to do a:
Code:
set +e
But still I cannot use/pass VAR1 in second script.