Quote:
Originally Posted by
sumitpandya
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.....
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...