URL:
<http://savannah.gnu.org/bugs/?25765>
Summary: grep -P regexp also prints the line before the
match
Project: grep
Submitted by: apsen
Submitted on: Срд 04 Мар 2009 19:01:05
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
As far as I could see this is not the same as one of previously reported
problems.
See tree examples below. The last one shows the problem.
G:\>grep -V
GNU grep 2.5.3
Copyright (C) 1988, 1992-2002, 2004, 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
G:\>cat test.s
a
1
G:\>od -a test.s
0000000 a nl 1 nl
0000004
G:\>cat test.s | grep -P "^[^0]1"
G:\>cat test.s | grep -P "^(|[^0])1"
1
G:\>cat test.s | grep -P "^(|.*[^0])1"
a
1
G:\>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?25765>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/