I am trying to access one script variable from another script for example,
script1.sh:
export a=10
export b=20
echo "testing"
exit
script2.sh:
. script1.sh
echo $a
The problem involved here is its able to access the variable 'a' from the script1 in script2 but its executing all the commands written in script1.sh which is annoying. I just want to access only the exported variables in script1 and donot want to run the commands in script1 while calling that in script2.
Kindly help!
Thanks,
Karthik