#!/bin/bash /bin/false & PID1=$! /bin/true & PID2=$! wait $PID1 RET1=$? wait $PID2 RET2=$? if [ $RET1 == 0 ] && [ $RET2 == 0 ]; then echo succeeded exit 0 else echo failed exit 1 fi
Execute multiple commands in background and evaluate their return codes
Leave a Reply
You must be logged in to post a comment.