I have the below parent script which calls a child script.
parent.sh
#!/bin/bash
export home=`pwd`
echo "calling child"
. ${home}/bin/child.sh
retn_code=$?
if (retn_code -ne 0)
then
exit $retn_code
else
echo "successful"
fi
exit 0
child.sh:
#!/bin/bash
exit 1
When I execute the parent script, the exit status of 1 is not getting captured in parent script. The last line of the log printed is "calling child" and there are no lines printed after that in log.
Is there something I am missing while getting the exit status from child to parent?