I have 2 shell scripts say a.sh and b.sh today, both are run standalone and have the exit code check like:
echo "Executing: $COMMAND"
eval $COMMAND
exitCode=$?
exit $exitCode
For a certain scenario I need to call b.sh from inside a.sh. I need to check if b.sh is getting called from a.sh then control should pass to a.sh after executing b.sh else follow the default behavior of b.sh
Is there any way in shell scripts I can get hold of the calling script? so that I can implement logic:
if ( calling script == a.sh)
then do not exit
else
follow the default behavior