svn commit: r225251 - user/gabor/grep/trunk

Gabor Kovesdan gabor at FreeBSD.org
Mon Aug 29 23:16:49 UTC 2011


On 2011.08.30. 0:59, Ben Kaduk wrote:
> On 8/29/11, Gabor Kovesdan<gabor at freebsd.org>  wrote:
>> Author: gabor
>> Date: Mon Aug 29 20:36:21 2011
>> New Revision: 225251
>> URL: http://svn.freebsd.org/changeset/base/225251
>>
>> Log:
>>    - Add support for xz[ef]?grep (1) and lz[ef]?grep.  The former handles
>> xz(1)
>>      compressed files and the latter lzma(1) compressed files.  The -X and -M
>>      command-line options can also be used respectively.
>>
> Is there a reason to not make just a single zgrep(1) binary that can
> tell what compression algorithm is in use and choose it as
> appropriate?  It seems like that would be more convenient from a
> user's perspective.
1, From xz(1) code it seems that there is no clean way of auto-detection 
between xz/lzma. I do not know about the rest because I haven't checked 
it. It may requie some preprocessing, which makes the code more complex 
or we could use libarchive but probably it has some overhead and 
performance is crucial in grep so I want to keep I/O as simple as possible.

2, bzgrep imho is kind of a de facto standard because of GNU despite not 
being part of POSIX so I prefer not to drop it. Similarly, xzgrep is 
part of XZ utils. In the case of lzgrep, yes, that's my invention to 
follow the convention.

Gabor


More information about the svn-src-user mailing list