title: Linux sed command does not change the target file
body: <p>With my shell script, when I run <code>./Test1 hello result</code>.</p>
  
  <p>It is supposed to take <code>hello</code> as standard input and result as standard output. The shell should remove any whitespace before <code>&lt;td&gt;</code>, <code>&lt;/td&gt;</code>, and <code>abc</code></p>
  
  <p>So, I write the script this way</p>
  
  <pre><code>tr -d [:blank:] &lt; $1
  grep -r "&lt;td&gt;" $1 | sed -r 's/&lt;td&gt;//g' &gt; $2
  sed -r 's/&lt;\/td&gt;//g' $2
  sed -r 's/abc//g' $2
  </code></pre>
  
  <p>However, when I run this command, the content of result file is exactly the same as the content of hello file (the only difference is the whitespace is removed)</p>
  
  <p>The file hello content:</p>
  
  <pre><code>&lt;td&gt;hello&lt;/td&gt;
    &lt;td&gt;hello&lt;/td&gt;
      &lt;td&gt;hello&lt;/td&gt;
  &lt;td&gt;abc&lt;/td&gt;
   &lt;td&gt;abc&lt;/td&gt;
  </code></pre>
  
  <p>How do I get <code>sed</code> to apply the change to the target file?</p>