title: How to use GNU sed on Mac OS 10.10+, 'brew install --default-names' no longer supported
body: <p>Under Mac OS 10.10.3, I installed gnu-sed by typing:</p>
  
  <pre><code>brew install gnu-sed --default-names
  </code></pre>
  
  <p>When I type it again, I get the message:</p>
  
  <p>gnu-sed-4.2.2 already installed</p>
  
  <p>However, even after rebooting the system and restarting Terminal, I still cannot use the GNU version of sed. For example:</p>
  
  <pre><code>echo a | sed ’s_A_X_i’
  </code></pre>
  
  <p>returns:
  bad flag in substitution command 'i'</p>
  
  <p>What should I do to get the GNU version working?
  Here are the paths in my $PATH variable.</p>
  
  <pre><code>/Users/WN/-myUnix
  /opt/local/bin
  /opt/local/sbin
  /usr/bin
  /bin
  /usr/sbin
  /sbin
  /usr/local/bin
  /Applications/calibre.app/Contents/MacOS
  /opt/ImageMagick/bin
  /usr/texbin 
  </code></pre>
  
  <p>I'm sorry if my question seems obvious, but I am learning shell scripting on my own and don't quite understand yet how UNIX programs are installed. Any help to use GNU compliant commands (in this case sed, but soon I'll need others as well) on my Mac without causing damage or unnecessary clutter would be greatly appreciated.</p>