On 2023/05/31 17:38, Paul Eggert wrote:
On 2023-05-30 14:01, [email protected] wrote:

Why is finding the desired text in a binary file not a "positive finding"
as it is in a text file?

But it is a positive finding. Grep exits with zero status, which is a positive result.

There is no perfect solution here. In the old days when 'grep' reported the situation to standard output, this made stdout confusing and we got bug reports about it.
I thought binary files were skipped, by default these days (along with
directories).  Only if the user's grep includes binary files should they
get positive findings from binary files.

I think that's the deciding factor -- if they want to scan binary files as
well as text, then positive results should be printed to stdout.

If they want to avoid message about the pattern being found in binary files, they
have the option to not scan binary files.

I.e. the tools for them getting those messages or not were already present. It seems
wrong to hamstring grep for those not knowing how to use the tool.





Reply via email to