bug-grep
[Top][All Lists]
Advanced

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

bug#31263: If grep given both --context and --max-count, context not pri


From: Paul Eggert
Subject: bug#31263: If grep given both --context and --max-count, context not printed if it contains pattern
Date: Wed, 25 Apr 2018 17:36:04 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 04/25/2018 03:00 PM, Joshua Nelson wrote:
$ cat tmp.txt > hi > hello > test > hey there > > $ grep -A 3 -m 1 h tmp.txt > hi >
> ``` > > Expected behavior: > hi > hello > test

Surely the output you expect should be:

hi
hello
test
hey there

because the "hey there" line is the third line of trailing context after the "hi" line. Anyway, the problem you're reporting was fixed in grep 3.1, so please try upgrading to the current version of grep.







reply via email to

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