title: Is there something wrong with sed for the mac terminal?
body: <p>I am having trouble making sed work on my mac terminal.  The original version I have is /usr/bin/sed
  I want to see what version it is so I type:</p>
  
  <pre><code>sed --version
  </code></pre>
  
  <p>I get the following output:</p>
  
  <blockquote>
    <p>/usr/bin/sed: illegal option -- - usage: sed script [-Ealn] [-i
    extension] [file ...]
           sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]</p>
  </blockquote>
  
  <p>My man page is for sed 4.2 and that should have a --version option</p>
  
  <p>I then installed to /usr/local/bin by downloading from gnu ftp <a href="http://ftp.gnu.org/gnu/sed/" rel="nofollow">http://ftp.gnu.org/gnu/sed/</a></p>
  
  <p>I then run <code>/usr/local/bin/sed</code> --version and still get same output as with original version.  I am completely confused, can anyone figure out what I am doing wrong?</p>
  
  <p>EDIT: It seems like even though <em>which sed</em> gives me <em>/usr/local/bin/sed</em> the command <em>sed</em> is still running <em>/usr/bin/sed</em>, consequently <em>/usr/local/bin/sed</em> is not being invoked. If I invoke with full path it works as expected.</p>
  
  <p>I guess question is now why <em>which sed</em> is giving me <em>/usr/local/bin/sed</em> yet the command run when I type <em>sed</em> is <em>/usr/bin/sed</em></p>