[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNU grep behavior
From: |
Stepan Kasal |
Subject: |
Re: GNU grep behavior |
Date: |
Thu, 26 Aug 2004 10:08:29 +0200 |
User-agent: |
Mutt/1.4.1i |
Hallo Dave,
On Wed, Aug 25, 2004 at 02:02:59PM +0100, Dave Hines wrote:
> Although I see that an option (-a, --text, --binary-files=text) exist to
> change this,
I'd add that you can set environment variable GREP_OPTIONS=--text
> I think that the new grep is wrong for two reasons:
>
> 1) Effort should be made not to break things when changes are made.
> The old behavior should be retained as the default case, and new
> behavior should be enabled by a switch, not disabled.
I agree with this in most cases. But applying this rule strictly would
preserve all misfeatures introduced by a mistake in design.
> (I have always been annoyed by software that thinks it knows better
> than I do, especially when it is wrong).
I have the same feelings. I'm sad that grep got among them.
> 2) The "Binary file %s matches\n" message should be sent to stderr,
> not stdout. The output of grep is supposed to be lines selected from
> the input, which that message is not.
I don't agree. The message is not a diagnostics message, it's a special
way of displaying data which are suspected to be binary garbage.
Sorry for the inconvenience,
Stepan Kasal