Norihiro Tanaka wrote:
Hmm, diff does not output "Binary file matches" between text files, but
grep does it.

I wasn't referring to the exact string "Binary file matches", merely to the idea that diff outputs a message to stdout saying that there was a binary file, rather than to stderr. Something like this:

$ diff /usr/bin/diff /usr/bin/emacs 2>/dev/null
Binary files /usr/bin/diff and /usr/bin/emacs differ

When a user got "Binary file matches" from grep, he can distinguish
whether matched a binary file or a line including "Binary file matches"
of a text file from only this result.

Although that's a problem, it's not a serious one, as one can easily work around it by using -n or -H. If there were need, I suppose we could add another operand to the --binary option to cause it to do something else with a match.



Reply via email to