bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: grep potential bug in compression lib


From: Stepan Kasal
Subject: Re: grep potential bug in compression lib
Date: Wed, 8 Jan 2003 12:52:03 +0100
User-agent: Mutt/1.2.5.1i

Hello,

On Wed, Jan 08, 2003 at 12:25:31PM +0100, Cyril Chaboisseau wrote:
> > A patch to zgrep script is attached to this mail.
> thanks

you're welcome.

> > grep -z means zero-terminated input, at least for GNU grep, so it's not
> > relevant here.
[...] 
> but what about the grep -z command which should have returned something
> else than the garbage it gives?

If it's GNU grep, then the meaning is this:
`-z'
`--null-data'
     Treat the input as a set of lines, each terminated by a zero byte
     (the ASCII `NUL' character) instead of a newline.  Like the `-Z'
     or `--null' option, this option can be used with commands like
     `sort -z' to process arbitrary file names.

[Try `info grep', `grep --help' or `man grep'.]

So GNU grep has no ability to decompress files.

If it's not GNU grep, then it's not relevalnt to discuss it here.

As you run grep with binary input, you get binary output.
GIGO (garbage in, garbage out).

> maybe it should give a result (with the numbering of all lines) just
> like it does for the non-compress version

That's what it does. Searches file for 0x0A bytes in the compressed (binary)
file and inserts ``line numbers'' at those spots.

> could it be another bug in the grep executable ?

So there is no bug.

Hope this makes things clear,
        Stepan Kasal




reply via email to

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