bsdgrep: does anyone see this?

From: <poyopoyo_at_puripuri.plala.or.jp>
Date: Sun, 18 Sep 2011 10:38:29 +0900
Hi,

On the latest -CURRENT of r225642 built with single line
"WITH_BSD_GREP=yes" in src.conf,

$ type -a grep
grep is /usr/bin/grep
$ grep -V
grep (BSD grep) 2.5.1-FreeBSD
$ locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME=C
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES=C
LC_ALL=
$ echo |grep -q '^'; echo $?
1
$ echo |grep -qv '^'; echo $?
0
$ echo |gnugrep -q '^'; echo $?
0
$ echo |gnugrep -qv '^'; echo $?
1
I believe GNU grep is correct, and bsdgrep inverts logic when input is
a newline. Imagine my astonishment when yes ""|grep -v '^$' scrolled
out console text instantly. :)

I also tested stock GNU grep on RELENG_8 chroot sandbox,
bsd-grep-20110912 from ports on both RELENG_8 and 9-CURRENT, and found
they work all OK as GNU grep. So I think this has been fixed in the
latest bsdgrep but not checked in to -CURRENT yet. Am I correct? Does
anyone see this on your 9-CURRENT box?

-- 
kuro
Received on Sat Sep 17 2011 - 23:38:32 UTC

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