This took a little time to find. But apparently this is very easy. I wanted to share some data in a shell script among some other shell script. So the obvious this to do is to include that shell script inside other shell scripts. To do this we have to use the “source” command.
echo "This is my script" ....
source otherscript.sh ....
echo "Called the other script"
What source command does is just execute the shell script and sharing the execution environment of the currently executing script. If you just call the script as ./otherscript.sh it will just execute with its own stack.