title: flush output in Bourne Shell
body: <p>I use echo in Upstart scripts to log things:</p>
  
  <pre><code>script
      echo "main: some data" &gt;&gt; log
  end script
  
  post-start script
      echo "post-start: another data" &gt;&gt; log
  end script
  </code></pre>
  
  <p>Now these two run in parallel, so in the logs I often see:</p>
  
  <pre><code>main: post-start: some data another data
  </code></pre>
  
  <p>This is not critical, so I won't employ proper synching, but thought I'd turn auto flush ON to at least reduce this effect. Is there an easy way to do that?</p>
  
  <p>Update: yes, flushing will not properly fix it, but I've seen it help such situations to some degree, and this is all I need in this case. It's just that I don't know how to do it in Shell</p>