GNU bug report logs -
#18863
grep -b bug
Previous Next
Reported by: 王琦 <wq_brilliant <at> 163.com>
Date: Tue, 28 Oct 2014 07:15:03 UTC
Severity: normal
Tags: notabug
Done: Eric Blake <eblake <at> redhat.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Hi, I found that "grep -b" doesn't work on my machine. the expected
> result for below command is "7:not", but I got 0 $ echo gnu is not
> unix | grep -b -o "not" 0:not Bash version 3.2.25 Linux version 2.6.18
What is version of your grep? I trid your test case on CentOS 5.10, and
I got the same results as you. As the bug was fixed in grep 2.6, it
does not occur in grep 2.20 which is most recently version.
$ uname -a
Linux cent58 2.6.18-371.el5 #1 SMP Tue Oct 1 08:37:57 EDT 2013 i386 i386 i386 GNU/Linux
$ bash --version
GNU bash, version 3.2.25(1)-release (i386-redhat-linux-gnu)
........
$ cat /etc/redhat-release
CentOS release 5.10 (Final)
$ echo gnu is not unix | env LC_ALL=C /bin/grep -b -o "not"
0:not
$ env LC_ALL=C /bin/grep --version
grep (GNU grep) 2.5.1
........
$ echo gnu is not unix | env LC_ALL=C grep -b -o "not"
7:not
$ env LC_ALL=C grep --version
grep (GNU grep) 2.20
........
Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
This bug report was last modified 10 years and 287 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.