title: How to load program reading stdin and taking parameters in gdb?
body: <blockquote>
    <p>I have a program that takes input from
    stdin and also takes some parameters
    from command line. It looks like this:</p>
  
  <pre><code>cat input.txt &gt; myprogram -path "/home/user/work"
  </code></pre>
    
    <p>I try to debug the code with gdb
    inside emacs, by M-x gdb, I try to
    load the program with the command:</p>
  
  <pre><code>gdb cat input.txt &gt; myprogram -path "/home/user/work"
  </code></pre>
    
    <p>However, gdb does not like it.</p>
  </blockquote>
  
  <p>Question cribbed from <a href="http://answers.yahoo.com/question/index?qid=20071102162016AASqPeB" rel="noreferrer">here</a>.
  Unfortunately I don't understand the solution and am not sure what to do beyond compiling with the <code>-g</code> option and running the command M-x gdb. </p>