gnu/156704: Improper behaviour of GNU grep

Artem Perekresny kondybas at gmail.com
Thu Apr 28 19:30:11 UTC 2011


>Number:         156704
>Category:       gnu
>Synopsis:       Improper behaviour of GNU grep
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 28 19:30:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Artem Perekresny
>Release:        386/7.3p4 am64/8.2
>Organization:
Private person
>Environment:
FreeBSD relay.maltitek.rv.ua 7.3-RELEASE-p4 FreeBSD 7.3-RELEASE-p4 #0: Sun Mar  6 12:00:45 EET 2011     artem at relay.maltitek.rv.ua:/usr/src/sys/i386/compile/MTEK  i386

>Description:
grep (GNU grep) 2.5.1-FreeBSD fails on "-o" option 

When pattern is alternatives joined with "|" option "-o" produce every possible matches ignoring "^", "\<", "\b" etc.


>How-To-Repeat:
# cat file.txt
ABCD
# egrep -o "^A" file.txt
A
# egrep -o "^B" file.txt
# egrep -o "^A|^B|^C|^D" file.txt
A
B
C
D
# cat file2.txt
DCBA
# egrep -o "^A|^B|^C|^D" file2.txt
D
C
B
A
#
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list