Hi All,
I have declared a variable in script1 and assign a value for it. In script2 i'll call script1 and then I want the value of variables set in script1.
I have tried with export, but in vain.
How can I achive this?
Below is the two scripts.
--script1
#!/usr/bin/ksh
echo $1
JAVA_HOME=/opt/java1.4
export JAVA_HOME
--script2
#!/usr/bin/ksh
./setValue.sh
echo "Java is present: ${JAVA_HOME}"
In script2 JAVA_HOME is empty, but in script1 JAVA_HOME has value.
Pls. help me in this.
Thanks in advance
vino
2
In script2, you need to invoke the other script as
. ./setValue.sh instead of just ./setValue.sh