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

2012-08-06 Thread Thomas Bushnell, BSG
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 "g

Re: zgrep - doesn't work if is two digits or greater

2012-08-06 Thread Eric Blake
On 08/06/2012 12:39 PM, Thomas Bushnell, BSG wrote: > Create a gzipped file: > >$ for i in $(seq 1 100); do echo $i; done > file.txt Save some effort, by using: seq 100 > file.txt > works. But: > >$ zgrep -10 17 file.txt.gz >gzip: 17.gz: No such file or directory Yep, the zgrep o

Re: zgrep - doesn't work if is two digits or greater

2012-08-06 Thread Thomas Bushnell, BSG
On Mon, Aug 6, 2012 at 3:20 PM, Eric Blake wrote: > On 08/06/2012 12:39 PM, Thomas Bushnell, BSG wrote: > > works. But: > > > >$ zgrep -10 17 file.txt.gz > >gzip: 17.gz: No such file or directory > > Yep, the zgrep option parser is busted on 2-digit numbers; it tries to > separate things

Re: zgrep - doesn't work if is two digits or greater

2012-08-06 Thread Eric Blake
On 08/06/2012 04:26 PM, Thomas Bushnell, BSG wrote: > So I think the answer is already there: *none *of the options are gzip > options, *all *of the options are grep options. > > Is the bug that zgrep is using the same parsing code as gzip, then? No, the bug is that while 'gzip' and 'grep' are C

Re: zgrep - doesn't work if is two digits or greater

2012-08-06 Thread Thomas Bushnell, BSG
eww. I just looked at the code. I don't blame you. :) On Mon, Aug 6, 2012 at 3:35 PM, Eric Blake wrote: > On 08/06/2012 04:26 PM, Thomas Bushnell, BSG wrote: > > So I think the answer is already there: *none *of the options are gzip > > options, *all *of the options are grep options. > > > > Is