GNU bug report logs - #47001
Feature request: give a meaning to -A/-B/-C with -o

Previous Next

Package: grep;

Reported by: Gregory Heytings <gregory <at> heytings.org>

Date: Mon, 8 Mar 2021 08:22:01 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Gregory Heytings <gregory <at> heytings.org>
To: 47001 <at> debbugs.gnu.org
Subject: bug#47001: Feature request: give a meaning to -A/-B/-C with -o
Date: Mon, 08 Mar 2021 08:21:27 +0000
Hi list,

Grep gives no meaning to the -A/-B/-C flags when they are used together 
with the -o flag (and prints a warning when they are used together).

I suggest to give them a specific meaning when the -o flag is used, namely 
to print NUM _characters_ of trailing/leading/output context around the 
match.

Currently this behavior can be obtained with "grep -oE 
'.{0,A}expose_frame.{0,B}'", where A and B are the number of leading and 
trailing context characters, but it is not efficient, and can become very 
inefficient for "large" values of A and B (say, 40).

Thanks,

Gregory




This bug report was last modified 4 years and 100 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.