zgrep does not correctly pass short options to grep
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gzip (Ubuntu) |
Fix Released
|
Low
|
Unassigned | ||
Precise |
Won't Fix
|
Low
|
Unassigned |
Bug Description
zgrep --help / man zgrep say that “OPTIONs are the same as for 'grep'.” and “All options specified are passed directly to grep.”, respectively. Testing shows that this does not work with the -h option:
-h, --no-filename
only standard input) to search.
cadams@platinum:~ $ zgrep -h 11689 /vol/wdl/
/vol/wdl/
cadams@platinum:~ $ zgrep --no-filename 11689 /vol/wdl/
1.2.3.4 - - [31/May/
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: gzip 1.4-1ubuntu2
ProcVersionSign
Uname: Linux 3.2.0-45-generic x86_64
ApportVersion: 2.0.1-0ubuntu17.3
Architecture: amd64
Date: Tue Jun 18 09:16:30 2013
MarkForUpload: True
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: gzip
UpgradeStatus: Upgraded to precise on 2012-11-23 (206 days ago)
Looks like a regression in Precise: it was fine in Lucid. The line in question is 141 of zgrep.in, which only got the "-h" option added post gzip 1.4 (commit cc1c692e4cf115e ce8391aaa5f4504 1065a0c64a, sSep 15th 2010).
Lucid has 1.3.12 of gzip, but gzip_1. 3.12-9ubuntu1. 1.diff patches zgrep to add -h to line 108 of zgrep.in.
Looks like that needs to be added as a patch in the Precise build (patch attached; just add to debian/patches dir and reference in "debian/ patches/ series" )
NB: Until this makes it into a package, "--no-filename" will have the equivalent effect.