Demonstrating behavior of exit
in shell scripts.
The desired behavior is that the script b.sh
is run in the middle of a.sh
or c.sh
. a.sh
and c.sh
only differ in how they call b.sh
.
Running a.sh
has the following output:
$ ./a.sh
starting a.sh
starting b.sh
Note that the final line in a.sh
is never executed.
Running c.sh
has the following output:
$ ./c.sh
starting c.sh
starting b.sh
ending c.sh
Now the final line in c.sh
is run.