How to make the variables of one script available for the other scripts?

Hello Everyone,

I want to know how can we make the variables of one script available for the other script?
for example i have three scripts variable_availability.sh,first.sh,second.sh and a file containing variables called common
----------------------------------

cat variable_availability.sh

#!/usr/local/bin/ksh
echo "starting the 1st script"
/root/Shell_Scripts/first.sh
echo "1st script finished"
echo "starting 2nd script"
/root/Shell_Scripts/second.sh
echo "2nd script finished"

--------------------------------

cat first.sh
#!/usr/local/bin/ksh
.  /root/Shell_Scripts/common
echo "The value of a=$a before modification"
a=`expr $a - 2`
echo "The value of a=$a after modification in 1st script"
echo "The value of b=$b before modification"
b=`expr $b + 2`
echo "The value of b=$b after modification in 1st script"

---------------------------------

cat second.sh
#!/usr/local/bin/ksh
.  /root/Shell_Scripts/common
echo "The value of a=$a in second script"
echo "the value of b=$b in second script"

----------------------------------------------

cat common

#!/usr/local/bin/ksh
a=10
b=20

--------------------------------------------
The output while running the variable_availability.sh script is as follows,
--------------------------------------------

starting the 1st script
The value of a=10 before modification
The value of a=8 after modification in 1st script
The value of b=20 before modification
The value of b=22 after modification in 1st script
1st script finished
starting 2nd script
The value of a=10 in second script
the value of b=20 in second script
2nd script finished

----------------------------------------------
The modified variables 'a' and 'b' in first.sh is not available for second.sh
Please share with me if anybody has any idea on this one.
Thanks in advance..........:confused:

You write desired "export VAR=VAL" into a temp file and execute "./temp" before "/root/Shell_Scripts/second.sh". In other way you can write "VAR=VAL" into temp file and execute ". temp" before "/root/Shell_Scripts/second.sh"

i tried as you said it's not working, i can't make those variables as global..cause the number of variable's are more.....:b:

but the second method worked thanks....

---------- Post updated at 11:51 PM ---------- Previous update was at 11:40 PM ----------

I got it...
at the end of first.sh script
i wrote those variables to file called var_temp.sh and i included that one in the second script like this as follows,

cat second.sh

#!/usr/local/bin/ksh
. /root/Shell_Scripts/var_temp.sh
echo "The value of a=$a in second script"
echo "the value of b=$b in second script"

the output came in this way,

starting the 1st script
The value of a=10 before modification
The value of a=8 after modification in 1st script
The value of b=20 before modification
The value of b=22 after modification in 1st script
1st script finished
starting 2nd script
The value of a=8 in second script
the value of b=22 in second script
2nd script finished

Thanks sumitpandya...