title: grep --ignore-case --only
body: <p>grep fails when using both --ignore-case and --only-match options.
  Example:</p>
  
  <pre><code>$ echo "abc" | grep -io abc
  abc
  $ echo "ABC" | grep -io abc
  $ 
  </code></pre>
  
  <p>But</p>
  
  <pre><code>$ echo "abc" | grep -i abc
  abc
  $ echo "ABC" | grep -i abc
  ABC
  </code></pre>
  
  <p>According to man page:</p>
  
  <blockquote>
  <pre><code>   -o, --only-matching
            Show only the part of a matching line that matches PATTERN.
     -i, --ignore-case
            Ignore case distinctions in both the PATTERN and the input files.
  </code></pre>
  </blockquote>
  
  <p>Is it a bug of grep or I didn't get the map page?</p>
  
  <p>I am using Mac OS X 10.6.8 and </p>
  
  <pre><code>$ grep --version
  grep (GNU grep) 2.5.1
  </code></pre>
  
  <p>Found this link: <a href="http://lists.gnu.org/archive/html/bug-gnu-utils/2003-11/msg00040.html" rel="noreferrer">http://lists.gnu.org/archive/html/bug-gnu-utils/2003-11/msg00040.html</a></p>
  
  <p>Of course it is possible to use workaround like <code>grep -o [aA][bB][cC]</code>, but this doesn't seem to be a good option.</p>