URL:
<http://savannah.gnu.org/bugs/?28906>
Summary: grep -Ax -q should print context but not matching
line
Project: grep
Submitted by: seahen
Submitted on: Mon 15 Feb 2010 05:18:54 PM GMT
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Binary package hint: grep
Version: 2.5.3~dfsg-6ubuntu1
It would occasionally be useful to be able to output *only* the lines
immediately before or after the matching lines, without printing the matching
lines themselves. The logical way to do this would be to use e.g. grep -A1 -q
(since -A1 adds the line after the match and -q suppresses normal output). But
this doesn't work; instead there is no output.
Steps to reproduce:
1. Create a file test.txt whose contents are:
the
quick
brown
fox
the
lazy
dog
2. grep -A1 -q the test.txt
Expected output:
quick
lazy
Actual output: nothing.
Reposting from downstream at
https://bugs.launchpad.net/ubuntu/+source/grep/+bug/396237
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?28906>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/