Bug 52594 - zgrep acts different than grep (and than in RH62)
Summary: zgrep acts different than grep (and than in RH62)
Keywords:
Status: CLOSED DUPLICATE of bug 43319
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gzip
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-26 01:08 UTC by gsr.bugs
Modified: 2007-04-18 16:36 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-08-27 11:13:57 UTC
Embargoed:


Attachments (Terms of Use)

Description gsr.bugs 2001-08-26 01:08:32 UTC
Description of Problem:

If you use grep in some files, you get one line of output per match,
and nothing more. But if you gzip them, and try zgrep, you get the
same, plus blank lines, like if no matches means "output one line".

Version-Release number of selected component (if applicable):

grep-2.4.2-5

How Reproducible:

Always.

Steps to Reproduce:

1. Create some text files, or find them.
2. Use grep to see how it works, how many lines it outputs.
3. Gzip the text files.
4. Use zgrep, step 2 output plus blank lines for files that do not have
the string.

Actual Results:

Blank lines, not what one expects from a Unix command (no matches, no
lines).

Expected Results:

Only lines with text as output.

Additional Information:

I upgraded from RH62, searched for a thing (zgrep thing gziped-files |
less) and I got lots of lines that are empty and some lines with what
I was searching for.

In RH62 only the useful text appeared so something in RH71 makes the
zgrep script work differently, maybe grep, maybe gzip, maybe bash...
not discovered yet.

As temp solution, I filter with sed -e "/^$/d" just after the zgrep
command.

Comment 1 Bernhard Rosenkraenzer 2001-08-27 11:13:52 UTC
zgrep is part of gzip, reassigning


Comment 2 Trond Eivind Glomsrxd 2001-08-27 16:23:11 UTC

*** This bug has been marked as a duplicate of 43319 ***


Note You need to log in before you can comment on or make changes to this bug.