title: Bash: read stdin from file and write stdout to file
body: <p>I'm trying to run an app (let's say <code>top</code>) so it will read from a file for stdin and write to another file from stdout.</p>
  
  <p>Currently I have</p>
  
  <pre><code>mkfifo stdin.pipe
  (tail -f stdin.pipe) | top
  </code></pre>
  
  <p>which works as expected, as I can then <code>echo</code> something to that file and top will receive it.
  But I'm unable to redirect the output of top.
  How can I achieve this?</p>
  
  <p>EDIT:</p>
  
  <p>Ok, let's scratch top.
  I'm testing with this:</p>
  
  <pre><code>cat test.sh
  
  echo Say something
  read something
  echo you said $something
  </code></pre>