On a linux shell I have essentially the following script
#!/usr/bin/env bash
set -e
python script.py arg1 &
python script.py arg2 &
python script.py arg3 &
wait
echo $?
in which some python programs can run in parallel, and I wait until the completion of the programs.
However, when I have only one failing programm for testing purposes which fails, the reported exit status is 0 (SUCCESS). I suspect that is the exit status of the wait
command. That is not what I want. I want to report an error (i.e. exit status unequal zero), if ANY of the programs did fail.
Is there a simple way to achieve this?