I have a bash script that parallelise some time-consuming commands and so far it runs perfectly. I am using wait command as follows:
docker pull */* &
docker pull */* &
docker pull */* &
docker pull */* &
docker pull */* &
docker pull */* &
docker pull */* &
composer install -n &
wait
Now I want this script to abort all commands and give exit code if one of the commands fail. How to achieve this?
Note: * / * are docker image names, not important for the context