bug-grep
[Top][All Lists]
Advanced

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

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


From: Paul Eggert
Subject: bug#51860: [PATCH] Reinstate Binary file matches to stdout
Date: Fri, 19 Nov 2021 01:22:23 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1

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'.





reply via email to

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