Bug 21113 - grep options -v and -A/B/C don't work together
grep options -v and -A/B/C don't work together
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: grep (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-11-20 01:58 EST by William Hester
Modified: 2007-04-18 12:29 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-11-20 01:58:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description William Hester 2000-11-20 01:58:47 EST
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 12:33:07 EST
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.