title: How to serialize echo'd and error output in bash scripts
body: <p>An annoying problem I frequently have when writing shell scripts is that the output from echo statements shows up <em>after</em> the output of commands that come after the echo statements.</p>
  
  <p>For example:</p>
  
  <pre><code>echo "step 1 -"
  ./step1
  
  echo "step 2 -"
  ./step2
  
  echo "step 3 -"
  ./step3
  </code></pre>
  
  <p>The output looks like this:</p>
  
  <pre><code>step1 output
  step2 output
  step3 output
  step 1 -
  step 2 - 
  step 3 - 
  </code></pre>
  
  <p>This defeats the purpose of those echo statements.  Is there any reasonably easy/convenient way to fix this?</p>