Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Nov 1999 21:13:54 -0500 (EST)
From:      Alain Magloire <alainm@rcsm.ece.mcgill.ca>
To:        obrien@freebsd.org
Cc:        tstromberg@rtci.com, freebsd-current@freebsd.org, bug-gnu-utils@gnu.org
Subject:   Re: Bad 'grep' behaviour in -CURRENT, faulty binary detection?
Message-ID:  <199911120213.VAA06622@mccoy2.ECE.McGill.CA>
In-Reply-To: <19991111132031.A60417@dragon.nuxi.com> from "David O'Brien" at Nov 11, 99 01:20:32 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Bonjour M. David O'Brien

> On Thu, Nov 11, 1999 at 03:29:05PM -0500, Thomas Stromberg wrote:
> > I just happened to notice this today. For some reason 'grep' seems to
> > think that 'set' output is binary, not text. Seems that GNU grep 2.3 is
> > a little too sensitive to text/binary detection.
> 

If I remember zsh has a "bug" and will output a NULL part of the IFS.

> I've got a notion to change this.  The -CURRENT grep is also very
> misleading w/ ``grep -l'' in that you will get "hits" on binary files
> because you can't see that "is a binary file" message to know better.

Of course, you can.  But I will join my voice to Paul and ask you not to.
This behaviour was a long standing request/grip where for example one would do 

grep pattern *

and have the terminal going bananas, if pattern was detected in binary
files or just by reading directories whith filenames containing *pattern*
(On Solaris, you can read() a directory).

> 
> The output of that message should be asked for with an option, not the
> default.  I can't imagine how many people are going to get weird/eronious
> output from scripts now due to it.

I don't follow your logic for '-l'.  whether it is grep-2.0 or grep-2.3
They all show the filename containing a matching pattern.
Grep-2.3 is just more carefull not to send binary data to stdout.

In the coming 2.4, if this is such problem for you, there is en environ
variable, that will restore the 2.0 behaviour(everything is text)

export GREP_OPTIONS=--text

-- 
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199911120213.VAA06622>