zgrep does not correctly pass short options to grep

Bug #1192168 reported by Chris Adams
12
This bug affects 1 person
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
              Suppress the prefixing of file names on output. This is the default when there is only one file (or
              only standard input) to search.

cadams@platinum:~ $ zgrep -h 11689 /vol/wdl/web-logs/*201306*.gz | head
/vol/wdl/web-logs/log.esclf_S.201305310000-201306010000-20130531-99.99c-0.gz:1.2.3.4 - - [31/May/2013:08:22:18 +0000] "GET /media/3570/service/dzi/1/22_files/10/1_0.jpg HTTP/1.1" 200 11689 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:21.0) Gecko/20100101 Firefox/21.0" "-"

cadams@platinum:~ $ zgrep --no-filename 11689 /vol/wdl/web-logs/*201306*.gz | head
1.2.3.4 - - [31/May/2013:08:22:18 +0000] "GET /media/3570/service/dzi/1/22_files/10/1_0.jpg HTTP/1.1" 200 11689 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:21.0) Gecko/20100101 Firefox/21.0" "-"

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: gzip 1.4-1ubuntu2
ProcVersionSignature: Ubuntu 3.2.0-45.70-generic 3.2.44
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-256color
 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)

Revision history for this message
Chris Adams (acdha) wrote :
Revision history for this message
Craig Miskell (3-crjig-7) wrote :

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 cc1c692e4cf115ece8391aaa5f45041065a0c64a, 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.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch to zgrep.in" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Brian Murray (brian-murray) wrote :

The -h option works in Saucy, which will become Ubuntu 13.10, so I am marking this bug as Fix Released and have opened a task for Precise.

Changed in gzip (Ubuntu):
importance: Undecided → Low
status: New → Fix Released
Changed in gzip (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in gzip (Ubuntu Precise):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.