title: run commands in parallel with exit fail if any command fails
body: <p>Need help in a bash script.
  The goal is:
  - Run several commands in parallel
  - Exit 1 if any command return not-zero exit status</p>
  
  <p>I.e.</p>
  
  <p>Run with middle command has error:</p>
  
  <pre><code>$ ./parallel_commands "echo 1" "_echo 2" "echo 3" &amp;&amp; echo "OK"
  1
  3
  ./parallel_commands: line 4: _echo: command not found
  OK &lt;- Incorrect
  </code></pre>
  
  <p>Run with all commands have errors:</p>
  
  <pre><code>$ ./parallel_commands "_echo 1" "_echo 2" "_echo 3" &amp;&amp; echo "OK"
  ./parallel_commands: line 4: _echo: command not found
  ./parallel_commands: line 4: _echo: command not found
  ./parallel_commands: line 4: _echo: command not found
  -&gt; Result is fail -&gt; Correct
  </code></pre>
  
  <p>Bash script:</p>
  
  <pre><code>#!/bin/bash
  
  for cmd in "$@"; do {
    $cmd &amp; pid=$!
    PID_LIST+=" $pid";
  } done
  
  trap "kill $PID_LIST" SIGINT
  
  wait $PID_LIST
  </code></pre>
  
  <p>Thanks.</p>