[mdlug] grep bug?

Paul set at pobox.com
Fri Apr 18 01:41:21 EDT 2008


Michael Corral <micorral at comcast.net>, on Thu Apr 17, 2008 [03:48:16 AM] said:
> 2008-04-16, Monsieur Robert Citek a ecrit:
> > I was running grep on my Ubuntu 7.10 box the other day and came across
> > some rather bizarre behaviour.  If I ran this grep command, everything
> > worked just fine:
> >
> > $ echo hello | grep --color=always -e ^
> >
> > However, if I make grep case-insensitive, grep seems to hang:
> >
> > $ echo hello | grep -i --color=always -e ^
> 

	Hi;

	Well, this happens with my gentoo grep also. It wasnt
hanging, but outputing an endless stream of the escape sequences
to turn on a color and turn it off. Since the terminal eats these,
it appears to hang. (its supposed to emit the 'color on' sequence,
the grep'd text, and then the 'color off' or 'restore color')
	So, I thought it might be some sort of terminal library
issue. No... grep has this functionality hardcoded into apparantly
several routines, and after looking at the code I decided I 
didnt really care enough to debug it.
	Since it works for Michael, and I am using the same
nominal version (gentoo has its own set of patches) one hopes
that redhat has fixed the problem, and it has traveled upstream.

Paul
set at pobox.com

> Might just be an Ubuntu-specific bug. Works fine in Fedora 7:
> 
> $ grep -V
> grep (GNU grep) 2.5.1
> 
> $ echo hello | grep -i --color=always -e ^
> hello
> 
> 
> Michael



More information about the mdlug mailing list