bug-grep
[Top][All Lists]
Advanced

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

[bug-grep] Re: grep


From: Stepan Kasal
Subject: [bug-grep] Re: grep
Date: Wed, 8 Dec 2004 15:39:25 +0100
User-agent: Mutt/1.4.1i

Hello,
   thank you very much for your bug report.

The bug report address has changed: bug-grep at the same domain is the
current address these days.  This list also serves as the point where
developers of grep meet.

On Tue, Dec 07, 2004 at 02:44:26PM -0700, W. B. Maguire II wrote:
> Unexpected behavior using 'grep' with the '-f' and '-P' options:

Yes, you are right, the combination doesn't work.

With curent CVS version of grep, you can use multiple -e options to
workaroud this bug:
grep -P -e a -e g target.txt

But, unfortunately, this doesn't seem to work with grep 2.5.1 on my
Red Hat.  (The version of pcre installed there might also be at fault.)

> 4) Grep *WITH* "--perl-regexp" _does_not_work_:
>    $ GREP_OPTIONS="" grep -P -f patterns.txt target.txt
>    [exits with a value of "1"]

If you try these:

    $ cat pat2
    a
    b
    c
    $ cat pat3
    .
    g
    $ exit

You'll see how the bug works.

> 5) And *I* found it because grep was failing with my
>    "$GREP_OPTIONS" environment variable setting:
> 
>    $ GREP_OPTIONS="--perl-regexp" grep -f patterns.txt target.txt

Well, the -P option is an experimental one.  It's not much supported
and may be buggy.  I was surprised to find out that the docs doesn't
say that.  So this doc deficiency is yet another bug...

Patches would be gratefully welcomed.

Have a nice day,
        Stepan Kasal




reply via email to

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