bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #28906] grep -Ax -q should print context but not matching line


From: Chris
Subject: [bug #28906] grep -Ax -q should print context but not matching line
Date: Mon, 15 Feb 2010 17:18:55 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100106 Ubuntu/9.10 (karmic) Firefox/3.5.7 GTB6

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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]