suppose I am running two commands in parallel in shell script, example below
/cmd1 &
pid1=$!
/cmd2 &
pid2=$!
status1= # what should go here?
status2=$? # I know this will have status of previous background process only
I want to proceed only if both the commands have clean exit status How do I check the status of first background process.