GNU bug report logs - #17799
grep 2.5.4 ignoring parts of expression

Previous Next

Package: grep;

Reported by: Jim Michaels <jmichae3 <at> yahoo.com>

Date: Wed, 18 Jun 2014 11:57:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 17799 <at> debbugs.gnu.org (full text, mbox):

From: Sekar Sundaram <inventsekarinfo <at> gmail.com>
To: 17799 <at> debbugs.gnu.org, eggert <at> cs.ucla.edu, jmichae3 <at> yahoo.com
Subject: Re: bug#17799: grep 2.5.4 ignoring parts of expression
Date: Thu, 19 Jun 2014 13:41:37 -0500
[Message part 1 (text/plain, inline)]
Hi Jim,
Lets say i want to search for "#include <bits/c++config.h>" (on my machine,
i could not find any random.h under c++ directory) and this below grep
command works fine for me..

dev-RH: root - redhat[/usr/include/c++/4.1.1]
*# grep -r "#include <bits/c++config.h>" **
backward/alloc.h:#include <bits/c++config.h>
backward/function.h:#include <bits/c++config.h>
backward/heap.h:#include <bits/c++config.h>
backward/pair.h:#include <bits/c++config.h>
.....
.....

maybe, lets search random.h under all subdirectories(-r) and only one
output per file(-m 1) will ok, to avoid screen full of texts.
*grep -r -m 1 "random.h" * *

Let us know if still you are facing any issues.

Have a great day!

*Best Regards,*

*Sekar *

*The smallest things can have the biggest impact. Look inside. - Intel*




On Wed, Jun 18, 2014 at 10:32 AM, Paul Eggert <eggert <at> cs.ucla.edu> wrote:

> Jim Michaels wrote:
>
>> grep random "#include <(bits/)?random(\.h)?>" *
>> expected: on the include/c++/bits dir of a gcc compiler should produce a
>> couple of results.
>>
>> actual: produces pages and pages with just about every file in it.
>> anything with the word random in it
>>
>
> That's because your command asked to find the word 'random'.  It's of the
> form:
>
> grep random LIST-OF-FILE-NAMES
>
> The first file name is "#include <(bits/)?random(\.h)?>", which grep
> complained to you about.
>
>
>
>
[Message part 2 (text/html, inline)]

This bug report was last modified 11 years and 31 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.