I'm using bash script, I'm trying to exit from a function in child shell script to parent shell script with returning status code.
Script1.sh
echo "hello script1"
. ./script2.sh
echo $?
Script2.sh
status()
{
echo "status"
return 1
}
status
echo "Hello shell2"
This script prints "status" and "Hello shell2", but I want to exit from status function of script2.sh to script1.sh without printing "Hello shell2".
I have checked some questions in stack overflow those talks about return from child script to parent and not from function of child to parent.
Thanks In Advance, Soman