title: bash: suppress kill message in while loop
body: <p>I have a progress bar that prints dots as it waits for an external program to finish executing. When it does finish, I get an ugly kill message which I want to suppress. </p>
  
  <pre><code>#!/bin/bash
  program &lt; input.file.1 &gt; output.1 &amp;
  
  sim='running simulation'
  
  echo -ne $sim &gt;&amp;2
  
  while kill -0 $!; do
  
         echo -n . &gt;&amp;2
         sleep 1
  done
  </code></pre>
  
  <p>Expected: running simulation.........</p>
  
  <p>Actual: running simulation........./run_with_dots.1: line 8: kill: (11872) - No such process</p>