GNU bug report logs - #51860
[PATCH] Reinstate Binary file matches to stdout

Previous Next

Package: grep;

Reported by: Duncan Roe <duncan_roe <at> optusnet.com.au>

Date: Mon, 15 Nov 2021 06:08:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Duncan Roe <duncan_roe <at> optusnet.com.au>
Cc: 51860 <at> debbugs.gnu.org
Subject: bug#51860: [PATCH] Reinstate Binary file matches to stdout
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'.




This bug report was last modified 3 years and 239 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.