Le 20/05/2018 à 18h03, Paul Eggert a écrit : > Garreau, Alexandre wrote: >> 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. > > I can see it the other way. For example, "show all lines that lack > signed integers, plus their context" can be done via a command like > "grep -C1 -v -E > '[-+][0-9]+([^.e]|$)'", and I don't see any easy way to do the same > search under the changes you're proposing. Oh in fact, I didn’t notice it actually had this effect… in fact when only a few lines don’t match, especially when they’re not contiguous, using -v with context options nearly equals not using grep at all… turns out I narrowed enough my mind to miss this. > In essence you're proposing a new feature that I'd call "negative > context"; i.e., if a line is not selected, then suppress the output of > nearby lines that are selected. grep already has a lot of features and > it's not clear this one is important enough to add. My memory is bad, but grepping at looking at my history for when I made up this example says me I needed this feature for something like this: