delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/11/23/10:52:23

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Date: Mon, 23 Nov 2009 10:51:16 -0500
Message-ID: <6dbd17a60911230751o68e4c6e6p47c9cc76c010be2b@mail.gmail.com>
Subject: grep --color=auto with -i option disables the matching text color
From: Alan Fay <emptyset AT gmail DOT com>
To: cygwin AT cygwin DOT com
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

Howdy!

I was trying to enable colors on the matching text for grep, and can't
get the formatting to work with the matching text.

# Partial contents of .zshenv
export GREP_OPTIONS="--color=auto"
export GREP_COLORS='mt=1;34'

# Problem command, no matching text (mt) appearing bold/blue, run in a
C# solution:
$ grep -R -n -i -e "functionFoo\(" --include=*.cs --exclude-dir=Logs *

# Command that works and highlights matching text, note that -i option disabled
$ grep -R -n -e "functionFoo\(" --include=*.cs --exclude-dir=Logs *

My superuser inquiry:
http://superuser.com/questions/73261/grep-colorauto-with-i-option-disables-the-matching-text-color-why

This problem was found with the following program/platform versions:

$ uname -a
CYGWIN_NT-6.0-WOW64 *** 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin

$ grep --version
GNU grep 2.5.3

$ zsh --version
zsh 4.3.9 (i686-pc-cygwin)

Windows Vista Business
Service Pack 2

Feel free to email me with anything that's missing.  I'm not sure if
this is a bug with Cygwin on Vista or perhaps grep.  I didn't find
much past the man pages on google with respect to grep colorization
(on any platform).

Thanks,
Alan

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

- Raw text -


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