title: using ruby popen wrapped in a shell script
body: <p>I finished my short file for a homework assignment which uses IO.popen("command").readlines to grab the STDOUT of that command. However, I need to write a shell script to wrap my ruby file in. No problem, but somehow putting it in the shell script makes readlines hang.</p>
  
  <pre><code>ruby script.rb foo example &gt; example.out
  </code></pre>
  
  <p>this works</p>
  
  <pre><code>script.sh foo example &gt;example.out
  </code></pre>
  
  <p>this hangs on readlines. <code>ruby script.rb</code> is all that script.sh contains.</p>