emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#28682: closed (Possible bug in conflict between -m


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#28682: closed (Possible bug in conflict between -m and -A)
Date: Thu, 05 Oct 2017 23:22:01 +0000

Your message dated Thu, 5 Oct 2017 16:21:17 -0700
with message-id <address@hidden>
and subject line Re: bug#28682: Possible bug in conflict between -m and -A
has caused the debbugs.gnu.org bug report #28682,
regarding Possible bug in conflict between -m and -A
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
28682: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28682
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Possible bug in conflict between -m and -A Date: Tue, 3 Oct 2017 01:00:14 -0500
Hi there! I have potentially found a suprising result when I use the grep options -m and -A together. It surprised me, so let me know if I've found a bug. It would be nice if I could contribute a fix - I'd love to contribute to the project.

Below is bash code to replicate.

Best regards,
Jesse

#############
#! /bin/bash

test='1 Hello
2 Hello
3 Hello
4 World
5 World
6 World
7 Hello
8 World'

[[ $( echo "$test" | grep -m 2 Hello | cat ) == '1 Hello
2 Hello' ]] && echo Pass || echo Fail

[[ $( echo "$test" | grep -A 2 Hello | cat ) == '1 Hello
2 Hello
3 Hello
4 World
5 World
--
7 Hello
8 World' ]] && echo Pass || echo Fail

[[ $( echo "$test" | grep -A 3 -m 3 Hello | cat ) == '1 Hello
2 Hello
3 Hello
4 World
5 World
6 World' ]] && echo Pass || echo Fail

[[ $( echo "$test" | grep -A 3 -m 2 Hello | cat ) == '1 Hello
2 Hello
3 Hello
4 World
5 World
6 World' ]] && echo Pass || echo Fail
echo Actually outputs:
echo "$test" | grep -A 3 -m 2 Hello | cat



--- End Message ---
--- Begin Message --- Subject: Re: bug#28682: Possible bug in conflict between -m and -A Date: Thu, 5 Oct 2017 16:21:17 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0
On 10/05/2017 04:06 PM, Jesse Eedrah wrote:
# grep (GNU grep) 2.27

Ah, the problem you describe was fixed in grep 3.1; please upgrade.



--- End Message ---

reply via email to

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