Bug 104867 - zgrep reports incorrect return codes when grepping /dev/null
zgrep reports incorrect return codes when grepping /dev/null
Product: Red Hat Linux
Classification: Retired
Component: gzip (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ivana Varekova
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2003-09-22 17:57 EDT by Reuben Thomas
Modified: 2007-04-18 12:57 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-12-10 07:29:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Reuben Thomas 2003-09-22 17:57:41 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; Linux i686; U) Opera 7.20  [en]

Description of problem:
When doing something like

zgrep foo /dev/null

I expect the same return code as

grep foo /dev/null

which returns 1, but I get 0.

This is because the return code of grep isn't scrutinised directly, only the 
return code of the sed command into which grep's output is piped. Oops. Not 
being a shell expert I've not yet come up with a decent fix; sorry.

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

How reproducible:

Steps to Reproduce:
1. grep foo /dev/null; echo $?
2. zgrep foo /dev/null; echo $?


Actual Results:  1

Expected Results:  1

Additional info:
Comment 1 Ivana Varekova 2004-12-10 07:29:00 EST
In gzip-1.3.3-13 zgrep works correctly.

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