Bug 21113 - grep options -v and -A/B/C don't work together
Summary: grep options -v and -A/B/C don't work together
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: grep
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: Aaron Brown
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-11-20 06:58 UTC by William Hester
Modified: 2007-04-18 16:29 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2000-11-20 06:58:52 UTC


Attachments (Terms of Use)

Description William Hester 2000-11-20 06:58:47 UTC
With a sample textfile containing:

GoodLine
GoodLine
Unknown
BadLine
GoodLine
GoodLine

"grep 'BadLine' -v -B1" will simply pass everything on like cat. 
It should just print "GoodLine" 4 times.  The same happens for -A and -C.

Comment 1 Bernhard Rosenkraenzer 2000-12-12 17:33:07 UTC
How is this supposed to be wrong?
grep 'BadLine' -v will include anything but BadLine, meaning all instances of
GoodLine and Unknown.

Since -B1 asks for a context line, BadLine will be displayed as context for line
5.


Note You need to log in before you can comment on or make changes to this bug.