title: Write to stdout, but save tail -n 1 to a file
body: <p>Is there anyway to run a process in the background while showing the real time updates in the <code>stdout</code> and only saving the last line (<code>tail -n 1 savefile</code>) to a file? There can be anywhere between 1 and 15 tests running at the same time and I need to be able to see that the tests are running but I do not want to save the entire text output.</p>
  
  <p>I should mention since the tests are running in the background I am using a <code>checkpid</code> loop to wait for the tests to finish</p>
  
  <p>also if it helps this is how my script is running the tests...</p>
  
  <pre><code>set runtest [exec -ignorestderr bsub -I -q lin_i make $testvar SEED=1 VPDDUMP=on |tail -n 1 &gt;&gt; $path0/runtestfile &amp;]
  </code></pre>
  
  <p>I have found that if I use <code>| tee</code> it causes the <code>checkpid</code> loop to skip but if I do <code>|tee</code> it does not display output.</p>