Subject: bug#51860: [PATCH] Reinstate Binary file matches to stdout

From: Paul Eggert <[email-masked]>
Date: Fri, 19 Nov 2021 01:22:23 -0800

On 11/18/21 17:19, Duncan Roe wrote:
> With regard to Bug#29668: they can use `grep -s -I`.
> Their real problem was that `-I` didn't work.

The problem I was referring to was described here:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29668#17

This is the problem of what an ordinary 'grep' user would expect with 
just 'grep PATTERN FILE | wc', without any options. When the "Binary 
file FILE matches" message is sent to 'wc' its information is lost to 
the user. When the message is sent to stderr, the user sees it and has a 
helpful indication that the usage is problematic.

Using 'grep -s -I' wouldn't have helped with this problem.

> They all use `grep --line-buffered` (since `less` to the tty
> will be line buffered), grep -s (to avoid stderr output which would mess up
> `less`)

You can use "grep PATTERN FILE 2>&1 | less". This shouldn't mess up 'less'.