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: Joshua Nelson
Subject: bug#31263: If grep given both --context and --max-count, context not printed if it contains pattern
Date: Wed, 25 Apr 2018 18:00:27 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

To the maintainers of GNU grep:

I came across a behavior I didn't expect when using grep with the flags
--after-context and --max-count. If PATTERN is in the context, it won't
be printed, presumably because I specified max count. Is this intended
or a bug?

```sh

$ cat tmp.txt
hi
hello
test
hey there

$ grep -A 3 -m 1 h tmp.txt
hi

```

Expected behavior:
hi
hello
test

Thanks for your time,
Joshua Nelson
-- 
B.S. Computer Science
College of Engineering and Computing | South Carolina Honors College
(813) 404-5744 <tel:8134045744> | address@hidden
<mailto:address@hidden>
GitHub <https://github.com/jyn514> | LinkedIn
<https://www.linkedin.com/in/joshuayn> | website
<https://jyn514.github.io/>
This message was sent with a PGP <https://jyn514.github.io/> signature.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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