zgrep -<NUM> doesn't work if <NUM> is two digits or greater

Bug #1032831 reported by Thomas Bushnell, BSG
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gzip
Fix Committed
Undecided
auto-bug-gzip
gzip (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Create a gzipped file:

   $ for i in $(seq 1 100); do echo $i; done > file.txt
   $ gzip file.txt

Then:

   $ zgrep -9 17 file.txt.gz
   8
   9
   ...
   25
   26

works. But:

   $ zgrep -10 17 file.txt.gz
   gzip: 17.gz: No such file or directory

fails.

Note that "grep -9 17 file.txt" and "grep -10 17 file.txt" work just fine.

Revision history for this message
Marcel Stimberg (marcelstimberg) wrote :

Thank you for your bug report. I can reproduce your issue on Ubuntu 12.04 (gzip: 1.4-1ubuntu2). This is an upstream bug, therefore it would be great if you could forward the bug to the developers. As far as I can see, they are not using a bug tracker but a mailing list: https://lists.gnu.org/mailman/listinfo/bug-gzip

Note that a workaround exists: Both
    zgrep -C 10 17 file.txt.gz
and
    zgrep --context=10 17 file.txt.gz
give the expected result.

Changed in gzip (Ubuntu):
status: New → Confirmed
Revision history for this message
Jim Meyering (meyering) wrote : upstream patch:
Changed in gzip:
status: New → In Progress
Revision history for this message
Marcel Stimberg (marcelstimberg) wrote :

The patch has been submitted upstream now:
http://git.savannah.gnu.org/cgit/gzip.git/commit/?id=dc6196e2a041c022f8382b7e610b095718acccfa

@Thomas Bushnell: Do you want to prepare a patch/merge request based on this commit (and the next one, which tests the behaviour)? Otherwise I can do it.

Changed in gzip:
status: In Progress → Fix Committed
Revision history for this message
Thomas Bushnell, BSG (tbushnell) wrote :

Given the easy workaround and the lack of urgency, I'd be happy for this to just get rolled out in the ordinary course of events.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

  • auto-bug-gzip Edit

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