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