GNU bug report logs - #16723
Bug using -A and -v at least in 2.14 of grep !?

Previous Next

Package: grep;

Reported by: "NICOLAI, Volker (AKKA IS)" <volker.nicolai.external <at> airbus.com>

Date: Tue, 11 Feb 2014 16:47:01 UTC

Severity: normal

Tags: notabug

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16723 in the body.
You can then email your comments to 16723 AT debbugs.gnu.org in the normal way.

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#16723; Package grep. (Tue, 11 Feb 2014 16:47:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "NICOLAI, Volker (AKKA IS)" <volker.nicolai.external <at> airbus.com>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Tue, 11 Feb 2014 16:47:02 GMT) Full text and rfc822 format available.

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

From: "NICOLAI, Volker (AKKA IS)" <volker.nicolai.external <at> airbus.com>
To: "bug-grep <at> gnu.org" <bug-grep <at> gnu.org>
Subject: Bug using -A and -v at least in 2.14 of grep !?
Date: Tue, 11 Feb 2014 15:13:12 +0100
[Message part 1 (text/plain, inline)]
Hi,
I tried to filter 3 repeating lines out of XML file. The first line contains "stylesheet".
The command I used is: grep -v -A 2 stylesheet FILENAME
The search without the -v works filtering out the 3 expected lines but the above command line does not work.
I would call that a bug - you too?
Looked into you reported bug, nothing there so I suspect 2.16. still hasn't changed here and I save my time triying.
Regards
Volker


The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.

[Message part 2 (text/html, inline)]

Added tag(s) notabug. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sat, 08 Mar 2014 23:11:01 GMT) Full text and rfc822 format available.

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sat, 08 Mar 2014 23:14:01 GMT) Full text and rfc822 format available.

Notification sent to "NICOLAI, Volker (AKKA IS)" <volker.nicolai.external <at> airbus.com>:
bug acknowledged by developer. (Sat, 08 Mar 2014 23:14:02 GMT) Full text and rfc822 format available.

Message #12 received at 16723-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 16723-done <at> debbugs.gnu.org
Subject: Re:  Bug using -A and -v at least in 2.14 of grep !?
Date: Sat, 08 Mar 2014 15:13:13 -0800
Sorry, I don't see a bug here.  grep -v PAT matches all lines that do 
not match PAT.  If a line doesn't contain the word 'stylesheet', 'grep 
-v stylesheet' will match the line even if it is adjacent to a line that 
does contain 'stylesheet', and -A 2 will then print the adjacent line.




Information forwarded to bug-grep <at> gnu.org:
bug#16723; Package grep. (Mon, 10 Mar 2014 07:12:02 GMT) Full text and rfc822 format available.

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

From: "NICOLAI, Volker (AKKA IS)" <volker.nicolai.external <at> airbus.com>
To: "16723 <at> debbugs.gnu.org" <16723 <at> debbugs.gnu.org>
Subject: AW: bug#16723: closed (Re:  Bug using -A and -v at least in 2.14 of
 grep !?)
Date: Mon, 10 Mar 2014 08:11:00 +0100
I agree, Paul, we could argue on what is the right behavior, but to make it clearer (because I might have been a bit misleading in my initial mail):
I want to get rid of the lines containing "stylesheet" and the two lines following that line because they belong together!
So
	grep -v -A 2 stylesheet FILENAME > NEWFILE
shall give me that new file without the "stylesheet" parts! 
That means the -A has to change behavior when using -v (-A sort of belongs to the -v then)!

The actual behavior you describe, Paul, is one that you probably only very rarely need - I reckon.
Regards
Volker


-----Ursprüngliche Nachricht-----
Von: GNU bug Tracking System [mailto:help-debbugs <at> gnu.org] 
Gesendet: Sonntag, 9. März 2014 00:14
An: NICOLAI, Volker (AKKA IS)
Betreff: bug#16723: closed (Re: Bug using -A and -v at least in 2.14 of grep !?)

Your bug report

#16723: Bug using -A and -v at least in 2.14 of grep !?

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 16723 <at> debbugs.gnu.org.

-- 
16723: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16723
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems

This mail has originated outside your organization, either from an external partner or the Global Internet.
Keep this in mind if you answer this message.



The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.


Information forwarded to bug-grep <at> gnu.org:
bug#16723; Package grep. (Mon, 10 Mar 2014 07:43:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "NICOLAI, Volker (AKKA IS)" <volker.nicolai.external <at> airbus.com>, 
 "16723 <at> debbugs.gnu.org" <16723 <at> debbugs.gnu.org>
Subject: Re: bug#16723: AW: bug#16723: closed (Re: Bug using -A and -v at
 least in 2.14 of grep !?)
Date: Mon, 10 Mar 2014 00:42:25 -0700
NICOLAI, Volker (AKKA IS) wrote:
> I want to get rid of the lines containing "stylesheet" and the two lines following that line because they belong together!

I see now, but that's not what grep does.  It'd be easy to write an Awk 
script to do what you want, and I suggest doing that.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 07 Apr 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 138 days ago.

Previous Next


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