Author: Philip Hazel Date: To: Sheri CC: pcre-dev Subject: Re: [pcre-dev] pcregrep --count option
On Fri, 17 Apr 2009, Sheri wrote:
> Was surprised (and thought it perhaps inappropriate) to be seeing files
> with zero matches included when the "--count" option is specified. Ditto
> even if the the "--files-with-matches" option is also included. Is that
> working correctly? Seems at odds with the documentation.
Showing zero matches with --count is compatible with GNU grep.
However with both -c and --files-with-matches, GNU grep just shows the
files with matches - BUT NO COUNTS! I think that's an infelicity in GNU
grep, but it does accord with the documentation, which says "scanning
will stop at the first match" for --files-with-matches.
Seems to me that with both options, only files with matches should be
show, with counts.