Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 52594

Summary: zgrep acts different than grep (and than in RH62)
Product: [Retired] Red Hat Linux Reporter: gsr.bugs
Component: gzipAssignee: Trond Eivind Glomsrxd <teg>
Status: CLOSED DUPLICATE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-08-27 11:13:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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