How to return control from the child script to the parent one?

I have two shell scripts : A.sh and B.sh

A.sh
echo "In A"
exec B.sh
echo "After B"

B.sh
echo "In B"

The output is : In A
In B

I want the output : In A
In B
After B

Then don't use exec -- it's not doing what you think it does.

echo "In A"
B.sh
echo "After B"

If B.sh is not in your path, you need to specify an explicit path (perhaps just ./B.sh)

$ cat A.sh
echo "In A"
./B.sh
echo "After B"

$ cat B.sh
echo "In B"

with above option, please check whether your b.sh has any exit code or not ????
if so, then most probably , after sucessfully executing b.sh , it's exitng out from your script because of this exit.

This one is my assumption .

Bad assumption, please try before you buy :wink: