Exit a bash script if an error occurs in it or any of the background jobs it creates
How to wait in bash for several subprocesses to finish and return exit code !=0 when any subprocess ends with code !=0?