title: Callback based on exit status of command in bash shell scripting?
body: <p>I have 10 commands executing in parallel:</p>
  
  <pre><code>comdA &amp; comdB &amp; comdC &amp; comdD
  </code></pre>
  
  <p>…</p>
  
  <p>Is there a way to execute a callback if any of these commands return an exit status other than 0?</p>
  
  <p>If this is not possible with bash. how about php? Can I</p>
  
  <pre><code>function exec_with_callback ($comd) {
  
      shell_exec($comd);
      callback();
  
  }
  
  exec_with_callback("comdA");
  exec_with_callback("comdB");
  ...
  but in parallel?
  </code></pre>
  
  <p>If no, what other language can I use?</p>