title: Input redirection the same as output redirection
body: <p>When I run the command:</p>
  
  <blockquote>
    <p>cat &lt; foo > foo</p>
  </blockquote>
  
  <p>With <strong>foo</strong> is an atribary file, I thought <strong>foo</strong> will remain the same since we make <strong>foo</strong> the input and output of <strong>cat</strong> command. But it turned out that this command erase <strong>foo</strong>. Otherwise, if I redirect the input to <strong>bar</strong> by</p>
  
  <blockquote>
    <p>cat &lt; foo > bar</p>
  </blockquote>
  
  <p>Then I got <strong>bar</strong> is the copy of <strong>foo</strong>. I can't figure it out why? What I am missing here?</p>