bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23234: unexpected results with charset handling in GNU grep 2.23


From: Paul Eggert
Subject: bug#23234: unexpected results with charset handling in GNU grep 2.23
Date: Wed, 6 Apr 2016 18:25:16 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1

On 04/06/2016 04:15 PM, Eric Blake wrote:
And yes, maybe we could change grep to print the "Binary file matches"
message to stderr, but that in turn will probably break other scripts,
and lead to even more complaints from people doing non-standard things
and expecting consistent results.

Yes, I'm dubious about this idea. grep's behavior was inspired by diff's similar behavior, and grep and diff have worked that way for many years and I expect people depend on it. POSIX says that diff should output its binary-file message to stdout, and I expect that if POSIX standardized grep's behavior on binary files it would do something similar.

Maybe changing the exit status when a binary file is encountered is
worth doing

Possibly, though I don't see the use case yet. If it's needed I suggest doing the change only if a new option is specified (--binary-files=error, say) so that it's upward-compatible with existing behavior.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]