Subject: Re: bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher

From: Eric Blake <[email-masked]>
Date: Sat, 23 Mar 2019 07:39:25 -0500

On 3/22/19 9:59 PM, Budi wrote:
> How make grep walking through FS by scanning breadth first instead of
> 
> On 3/23/19, Budi <[email-masked]> wrote:
>> How make grep walinh through FS by scanning breadth first instead of
>> the usual depth
>>
>> On 3/23/19, Norihiro Tanaka <[email-masked]> wrote:
>>> On Sat, 23 Mar 2019 08:06:35 +0900
>>> Norihiro Tanaka <[email-masked]> wrote:
>>>
>>>> A kwset matcher is not built in a grep matcher after token re-order is

Budi,

Hijacking a tread on a posted patch to ask an unrelated question via
top-posting is not very nice netiquette.  Better is to start a new
thread for asking questions, and to use bottom posting for technical lists.

That said, the answer to your question is that there is no way to change
the way that grep walks the file system when using 'grep -r'. And when
you consider that 'grep -r' is a GNU extension not required by POSIX
(http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html),
and that we are reluctant to bloat grep any further when 'find' already
exists as the POSIX-sanctioned file walker, you are better off getting
'find' to do the traversal you want (where find or xargs is used to
invoke plain 'grep' on the resulting files) rather than trying to
convince us to patch 'grep -r' to have more flexibility.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org