I have this bash script to start some servers:
services=(
account-service
reminder-service
activity-service
socket-service
chat-service
web-app
)
for s in "${services[@]}"; do
(
set -e;
cd "$s"
git pull
echo "$cmd" | bash
) &
sleep 1;
done
wait;
sometimes the git pull command will fail. But the failure is deep in the logs and not always obviously. How can I abort the whole script if one of the commands in the subshell exits with 1?