GNU bug report logs -
#63780
Reversing the grep message output type matching binary files (without the -a option added) changed from stdout to stderr
Previous Next
Reported by: "2773414454" <2773414454 <at> qq.com>
Date: Mon, 29 May 2023 04:56:02 UTC
Severity: normal
Tags: notabug
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #45 received at 63780 <at> debbugs.gnu.org (full text, mbox):
On 2023/05/31 17:38, Paul Eggert wrote:
> On 2023-05-30 14:01, gnu <at> tlinx.org 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.
>
This bug report was last modified 1 year and 357 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.