buggrep - Bugs: bug #28588, -m breaks -A

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #28588: -m breaks -A

Submitted by:  Markus Jochim <angus>
Submitted on:  Wed 13 Jan 2010 10:52:50 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: In Progress
Privacy: PublicAssigned to: None
Open/Closed: Open

Thu 24 Jul 2014 07:31:12 AM UTC, comment #2:

This also affects -m1 -C5, very annoying.

Kevin Brubeck Unhammer <unhammer>
Sat 06 Feb 2010 01:36:04 PM UTC, comment #1:

I replied on the mailing list:

http://thread.gmane.org/gmane.comp.gnu.grep.bugs/2237/focus=2244

If you have feedback, please follow up there.

Jim Meyering <meyering>
Project Administrator
Wed 13 Jan 2010 10:52:50 AM UTC, original submission:

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

Markus Jochim <angus>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by unhammer
  • -unavailable- added by unhammer (Posted a comment)
  • -unavailable- added by meyering (Posted a comment)
  • -unavailable- added by angus (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 24 Jul 2014 07:31:12 AM UTCunhammerCarbon-Copy-=>Added unhammer
    Sat 06 Feb 2010 01:36:04 PM UTCmeyeringStatusNone=>In Progress

    Back to the top


    Powered by Savane 3.1-cleanup