[Top][All Lists]

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

bug#31537: Combining -v and -A/-B/-C options

From: Garreau\, Alexandre
Subject: bug#31537: Combining -v and -A/-B/-C options
Date: Sun, 20 May 2018 03:15:43 +0200
User-agent: Gnus (5.13), GNU Emacs 25.1.1 (x86_64-pc-linux-gnu)

It seems using a context option (-A (after-), -B (before-) or -C
(context)) when -v (invert-match) is in use just do nothing as well as
disabling the later.  I don’t see the utility of this behavior, as well
as I didn’t see it documented anywhere in the description of any of
these options.

I believe context options used in conjonction with invert-match option
should specify which lines *not to show* along with matched then not
shown lines.

For instance, while this command:
seq 1 100 | grep -v '2$'
does show the list of numbers going from 1 to 100, without those ending
with “2” in base 10, this one:
seq 1 100 | grep -v '2$' -A 1
should also hide the lines ending with “3” because they systematically
follow those ending with “2” (currently it just show all the numbers
from 1 to 100).

I didn’t look at if grep does act differently according the order
options are given, but if so maybe this behavior could be triggered only
if the context option were specified *after* the invert-match one?

Thank you for any attention!

reply via email to

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