bug-grep
[Top][All Lists]
Advanced

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

[bug #28588] -m breaks -A


From: Markus Jochim
Subject: [bug #28588] -m breaks -A
Date: Wed, 13 Jan 2010 10:52:50 +0000
User-agent: Opera/9.80 (X11; Linux x86_64; U; de) Presto/2.2.15 Version/10.20

URL:
  <http://savannah.gnu.org/bugs/?28588>

                 Summary: -m breaks -A
                 Project: grep
            Submitted by: angus
            Submitted on: Mi 13 Jan 2010 10:52:50 GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

GNU grep 2.5.4 - Archlinux - zsh

I've created a sample input file to show the bug I've encountered in GNU
grep.

sample.input:
attention
this is the first
while this looks like the second
and this smells of third
attention
fourth

Doing `grep -m 1 attention sample.input` behaves as expected. Just so do
`grep -m 1 -A {1,2,3} attention sample.input`. But as soon as I increase the
lines of trailing context to four or more, grep will crop the output.

$ grep -m 1 -A 5 attention sample.input
attention
this is the first
while this looks like the second
and this smells of third

Apparently, any non-first (for -m 1) occurence of the pattern is dropped even
though it is part of the "five lines of trailing context" and must therefore
be displayed.

I'd love to see this fixed,

Markus Jochim




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?28588>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/





reply via email to

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