GNU bug report logs - #39591
grep v3.4 after-context

Previous Next

Package: grep;

Reported by: "Adams, John" <john.adams <at> anritsu.com>

Date: Thu, 13 Feb 2020 16:58:01 UTC

Severity: normal

Tags: moreinfo

To reply to this bug, email your comments to 39591 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#39591; Package grep. (Thu, 13 Feb 2020 16:58:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Adams, John" <john.adams <at> anritsu.com>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Thu, 13 Feb 2020 16:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Adams, John" <john.adams <at> anritsu.com>
To: "bug-grep <at> gnu.org" <bug-grep <at> gnu.org>
Subject: grep v3.4 after-context
Date: Thu, 13 Feb 2020 16:49:17 +0000
[Message part 1 (text/plain, inline)]
Recent greps do not behave as documented with respect to after-context.  In the past I've been accustomed to -AX meaning print X lines of after context.  That is not how gnu grep is working now, but it is how it is documented.  In fact -AX, which I tested with a v3.4 that I build on Ubuntu 18, will print X+1 lines of after-context.  If you want 1, you must say -A0.
[Message part 2 (text/html, inline)]

Information forwarded to bug-grep <at> gnu.org:
bug#39591; Package grep. (Sat, 22 Feb 2020 03:09:02 GMT) Full text and rfc822 format available.

Message #8 received at 39591 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: "Adams, John" <john.adams <at> anritsu.com>
Cc: 39591 <at> debbugs.gnu.org
Subject: Re: bug#39591: grep v3.4 after-context
Date: Fri, 21 Feb 2020 19:08:16 -0800
tags 39591 + moreinfo
stop

On Thu, Feb 13, 2020 at 8:58 AM Adams, John <john.adams <at> anritsu.com> wrote:
> Recent greps do not behave as documented with respect to after-context.  In the past I've been accustomed to -AX meaning print X lines of after context.  That is not how gnu grep is working now, but it is how it is documented.  In fact -AX, which I tested with a v3.4 that I build on Ubuntu 18, will print X+1 lines of after-context.  If you want 1, you must say -A0.

Thanks for the report. Can you provide a stand-alone example like the
following to demonstrate the problem?
I am unable to reproduce it so far, since this prints only one line of
following context:

$ printf '%s\n' a b c d e | grep -A1 c
c
d




Added tag(s) moreinfo. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Mon, 21 Sep 2020 19:14:02 GMT) Full text and rfc822 format available.

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

Previous Next


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