title: How would I run a command line program and feed it data through stdin
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8792376/erlang-ports-interfacing-with-a-wc-like-program">Erlang Ports: Interfacing with a &ldquo;wc&rdquo;-like program?</a>  </p>
  </blockquote>
  
  
  
  <p>What I've been doing is writing to a file in /tmp/ and then running os:cmd("cat /tmp/tmp.txt | myprogram"). There's got to be a better way though.</p>
  
  <p>edit: this question is same but unanswered <a href="https://stackoverflow.com/questions/8792376/erlang-ports-interfacing-with-a-wc-like-program">Erlang Ports: Interfacing with a &quot;wc&quot;-like program?</a></p>
  
  <p>This is similar but with weird answer which I don't think is better than what I've done <a href="http://erlang.2086793.n4.nabble.com/open-pipe-spawn-quot-cat-quot-how-to-close-stdin-of-cat-td2112721.html" rel="nofollow noreferrer">http://erlang.2086793.n4.nabble.com/open-pipe-spawn-quot-cat-quot-how-to-close-stdin-of-cat-td2112721.html</a></p>
  
  <p>This also has no solution <a href="http://erlang.2086793.n4.nabble.com/open-port-issue-td2103107.html" rel="nofollow noreferrer">http://erlang.2086793.n4.nabble.com/open-port-issue-td2103107.html</a></p>