Given after-context=3 it is expected to output at least 4 lines
as documented, but adding max-count=1 makes it stop on the next
matching line.
Thanks for reporting this. Although grep's behavior is documented ("context does
not include matching lines" in the node General Output Control) the
> Igor Bogomazov filed the following bug against grep in
> Debian.
>
> > $ printf '%s\n' a b a c | grep -m1 -A3 a
> >
> > What I see:
> >
> > a
> > b
> >
> > What I expect:
> >
> > a
> > b
> > a
> > c
As long as looking at prepending(), I see that it is designed but not
2 matches
Mail list logo