bsdgrep: xzgrep gives up searching too early

From: <poyopoyo_at_puripuri.plala.or.jp>
Date: Wed, 15 Feb 2012 05:46:59 +0900
This is -CURRENT of r231204, 9 Feb.

xzgrep seems to give up at first read().

$ yes a|head|xz|xzgrep -c a
10
$ yes a|head -100|xz|xzgrep -c a
100
$ yes a|head -10000|xz|xzgrep -c a
10000
$ yes a|head -100000|xz|xzgrep -c a
16384

bzgrep, zgrep and grep works as expected.

$ yes a|head|bzip2|bzgrep -c a
10
$ yes a|head -100|bzip2|bzgrep -c a
100
$ yes a|head -1000|bzip2|bzgrep -c a
1000
$ yes a|head -10000|bzip2|bzgrep -c a
10000
$ yes a|head -100000|bzip2|bzgrep -c a
100000
$ yes a|head -1000000|bzip2|bzgrep -c a
1000000
$ yes a|head -10000000|bzip2|bzgrep -c a
10000000

$ yes a|head|gzip|zgrep -c a
10
$ yes a|head -100|gzip|zgrep -c a
100
$ yes a|head -1000|gzip|zgrep -c a
1000
$ yes a|head -10000|gzip|zgrep -c a
10000
$ yes a|head -100000|gzip|zgrep -c a
100000
$ yes a|head -1000000|gzip|zgrep -c a
1000000
$ yes a|head -10000000|gzip|zgrep -c a
10000000

$ yes a|head|grep -c a
10
$ yes a|head -100|grep -c a
100
$ yes a|head -1000|grep -c a
1000
$ yes a|head -10000|grep -c a
10000
$ yes a|head -100000|grep -c a
100000
$ yes a|head -1000000|grep -c a
1000000
$ yes a|head -10000000|grep -c a
10000000

they are single binary (linked statically)

$ for f in xzgrep bzgrep zgrep grep; do ls -l $(which $f); done
-r-xr-xr-x  15 root  wheel  578352 Feb  2 00:39 /usr/bin/xzgrep*
-r-xr-xr-x  15 root  wheel  578352 Feb  2 00:39 /usr/bin/bzgrep*
-r-xr-xr-x  15 root  wheel  578352 Feb  2 00:39 /usr/bin/zgrep*
-r-xr-xr-x  15 root  wheel  578352 Feb  2 00:39 /usr/bin/grep*

-- 
kuro
Received on Tue Feb 14 2012 - 19:58:25 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:24 UTC