title: Can a bash script run simultaneous commands then wait for them to complete?
body: <p>I want to write a bash script where I run two commands simultaneously, then continue when they both complete.</p>
  
  <p>Here's something that doesn't work, but I'll put it here to illustrate what I'm trying to do:</p>
  
  <pre><code>#!/bin/bash
  ./job1 &amp;
  ./job2
  ./dostuffwithresults
  </code></pre>
  
  <p>The script will run both job1 and job2 at the same time, but will only wait for job2 to finish before continuing. If job1 takes longer, then the results might not be ready for the final command.</p>