Bug 52594 - zgrep acts different than grep (and than in RH62)
zgrep acts different than grep (and than in RH62)
Status: CLOSED DUPLICATE of bug 43319
Product: Red Hat Linux
Classification: Retired
Component: gzip (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-08-25 21:08 EDT by gsr.bugs
Modified: 2007-04-18 12:36 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-08-27 07:13:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description gsr.bugs 2001-08-25 21:08:32 EDT
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 07:13:52 EDT
zgrep is part of gzip, reassigning
Comment 2 Trond Eivind Glomsrxd 2001-08-27 12:23:11 EDT

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