bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep 2.5 on recent cygwin - end-of-line problem


From: olivier Dulac
Subject: Re: grep 2.5 on recent cygwin - end-of-line problem
Date: Fri, 29 Oct 2004 19:52:22 +0200



From: Stepan Kasal
To: olivier Dulac
CC: address@hidden


> but I can't use the vim or less highlighting for some devious reasons)

Have you tried Windows vim?

I use vim all day long :) either on windows or on unices (linux too).
But I don't want to use grep --color, as I think it would be optimized for
what I need (finding a regexp line per line and highlight it for later display
on the same kind of terminal, so the escape characters are a must, and
grep is the ultimate line-pet-line regexp seeker :) )

The best way to achieve this is
        grep --color -e 'your_regex' -e ''

Good one :)
I wrongly assumed that finding "$" was "faster" as it is easy for grep to
know what it "looks like"... but now that you show it to me it's true that
" '' " is as fast as it is easy for grep to see a matching empty line on each
lines : there is always a match on each beginning of lines
(and it does match the empty lines too!)
I wrongly thought it would then continue to search as many match as
nb_of_cars+1, looking for the longest possible match!

It looks as if grep were writing

        START_COLOR END_COLOR  START_COLOR END_COLOR  ...

in an endless loop.  So it's half chance you break it in the "color" mode.

Yes! I should have guessed that the "sometimes, sometimes not" was due
to my interaction in this kind of loop. I bow in your general direction :)

I'd use it in the Cygwin prompt, it's bash shell, as on GNU/Linux.

That's what I use, but according to cygwin's docs, no single environement
is "the best" (hey, that's easy to agree on, it's microsoft's!)

> Q4) what tools can I use, in Cygwin, to try to pin down where the actual
>   problem is ?  is "gdb" or "strace" usefull in this environement?
[...]
>   flame me first :)
<flame>Heck, I don't know, I haven't used Cygwin much.</flame>

Then I can tell you that I'd just added some prinntf's to the grep
source to see which functions are called.  Old, reliable method.  ;-)

... as long as you don't forget to "fflush" each of them ;)
(took me a long time to debug the wrong part of a compiler just because
of that, on a Sun Sparc)

> And I'll try to contribute some day (when I really learn how to program,
> and get some free time, and, oh yes, find something I am actually able to
> help with!)

It's very important that you are _willing_ to contribute.
Take it easy, a good opportunity will surely come.

Have a nice day,
        Stepan Kasal

Have a nice day too :)

And I'll look into grep's source as soon as I get a chance :)

 Olivier Dulac.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]