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

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

Re: bug in grep?


From: Stepan Kasal
Subject: Re: bug in grep?
Date: Thu, 11 Sep 2003 09:10:03 +0200
User-agent: Mutt/1.2.5.1i

Hello,

On Wed, Sep 10, 2003 at 03:10:08PM +0200, address@hidden wrote:
>            $INCLUDE 'OMA'             .
> 
> cat test | grep -xv ' +\$INCLUDE.*'
> 
> but surprise surprise grep does not recognize this pattern

grep uses so called basic regular expressions (BRE), which don't
have the + metacharacter.

A standard way is to use "grep -E" (a.k.a. egrep) to get "extended reg.
expressions" (ERE) which have more meta characters:
        grep -Ev ' +\$INCLUDE'

With GNU grep, you can also use '\+' in BRE's, ie. this way:
        grep -v ' \+\$INCLUDE'

HTH,
        Stepan Kasal




reply via email to

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