Lets say I have apple.sh
set -e
...some commands #X...
./banana.sh
...more commands #Y..
and then banana.sh
set -e
...some commands #Z...
My expectation was that if an error was thrown somewhere in banana.sh, that this would quit banana.sh in an error state, and therefore apple.sh would also see the error and quit. I feel like I've even seen that be the behavior. But now I am seeing that this is not true, and while banana.sh quits as expected when an error occurs, apple.sh barges on from there continuing on with the "some commands #Y" stuff.
How can I make the error in banana bubble up and be caught by apple?
This is on RHEL5
./banada.shexits with an error thanapple.shexits too. You should debug this by insertingecho $?just after the invocation of./banada.shinapple.shso see if the banada is really failing.