delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/09/24/19:18:07

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Wed, 24 Sep 2008 16:17:16 -0700
From: Gary Johnson <garyjohn AT spk DOT agilent DOT com>
To: cygwin AT cygwin DOT com
Subject: Bug in grep when -i used with -o and/or --color=auto
Message-ID: <20080924231714.GA1293@suncomp1.spk.agilent.com>
Mail-Followup-To: cygwin AT cygwin DOT com
MIME-Version: 1.0
X-Operating-System: SunOS suncomp1 5.8 sparc
User-Agent: Mutt/1.5.17 (2007-11-01)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Cygwin's grep appears to give incorrect results when given the -i 
option in combination with the --color=auto and/or -o options.

For example,

   grep --color=auto You /etc/motd

prints the line

   You are successfully logged in to this server!!!

as expected, with "You" in red.  However, while

   grep --color=auto -i you /etc/motd

prints the same line, "You" is not colored.

As another example,

   grep -o You /etc/motd

prints just

   You

as expected, but

   grep -o -i you /etc/motd

prints nothing.

Those option combinations work correctly with /bin/grep (GNU grep) 
2.5.1 on a machine running Red Hat Enterprise Linux WS release 4.

   $ uname -a
   CYGWIN_NT-5.1 tc-merlin 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin

   $ which grep
   /usr/bin/grep

   $ cygcheck -c grep
   Cygwin Package Information
   Package              Version        Status
   grep                 2.5.1a-4       OK

Regards,
Gary


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019