It might even be simpler. Read carefully man bash. (I said, carefully.)
Normally, when you execute a series of commands, bash will wait for that process to terminate before proceeding, although it provides the & suffix to allow for parallel execution. Normally, bash forks the child process, then goes to sleep waiting for it to finish so that it can reap the child and collect its ending status. If that's not happening for you, please provide us with an appropriate excerpt of your actual script.
|