Red Hat Bugzilla – Bug 52594
zgrep acts different than grep (and than in RH62)
Last modified: 2007-04-18 12:36:36 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):
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
Blank lines, not what one expects from a Unix command (no matches, no
Only lines with text as output.
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
zgrep is part of gzip, reassigning
*** This bug has been marked as a duplicate of 43319 ***