Subject: Re: bug#17799: grep 2.5.4 ignoring parts of expression

From: Paul Eggert <[email-masked]>
Date: Wed, 18 Jun 2014 08:32:18 -0700

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.