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 option parser is busted on 2-digit numbers; it tries to separate things into '-1 0' rather than rewriting it to '-C 10' or even passing it through unchanged. But you must remember that gzip _already_ understands '-1' through '-9' as independent options. So which should win? Should zgrep assume that you are asking for option -1 followed by option -0 for use by gzip, or that you are asking for option -10 understood by grep? Or do the numeric options of gzip only apply to compression, but zgrep implies decompression, therefore we should be assuming grep syntax instead of gzip? > Please include me in the CC on any replies. That's list policy, anyway. -- Eric Blake [email protected] +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
