GNU bug report logs - #17032
side effect bug...

Previous Next

Package: grep;

Reported by: Roméo Capulet <p-pioneer-q <at> gmx.fr>

Date: Tue, 18 Mar 2014 05:00:03 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

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 17032 in the body.
You can then email your comments to 17032 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#17032; Package grep. (Tue, 18 Mar 2014 05:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roméo Capulet <p-pioneer-q <at> gmx.fr>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Tue, 18 Mar 2014 05:00:04 GMT) Full text and rfc822 format available.

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

From: Roméo Capulet <p-pioneer-q <at> gmx.fr>
To: bug-grep <at> gnu.org
Subject: side effect bug...
Date: Tue, 18 Mar 2014 05:41:15 +0100
The option "-n" have a side effect with the option "-P" and the regexp 
'^\r$', the line numbers got overwritten by the carriage return char so 
these don't appear on output.

cmd ex: grep -Pn '^\r$' file.txt

ps: I know I can see the numbers by redirecting output in a file.




Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Tue, 18 Mar 2014 16:01:02 GMT) Full text and rfc822 format available.

Notification sent to Roméo Capulet <p-pioneer-q <at> gmx.fr>:
bug acknowledged by developer. (Tue, 18 Mar 2014 16:01:03 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: Roméo Capulet <p-pioneer-q <at> gmx.fr>
Cc: 17032-done <at> debbugs.gnu.org
Subject: Re: bug#17032: side effect bug...
Date: Tue, 18 Mar 2014 08:59:39 -0700
tags 17032 + notabug
thanks

On Mon, Mar 17, 2014 at 9:41 PM, Roméo Capulet <p-pioneer-q <at> gmx.fr> wrote:
> The option "-n" have a side effect with the option "-P" and the regexp
> '^\r$', the line numbers got overwritten by the carriage return char so
> these don't appear on output.
>
> cmd ex: grep -Pn '^\r$' file.txt
>
> ps: I know I can see the numbers by redirecting output in a file.

Thanks for the report.
You can avoid that in at least two ways: either filter out all \r bytes
or filter through something like cat -A that renders them another way:

  grep -Pn '^\r$' file.txt | tr -d '\r'

or

  grep -Pn '^\r$' file.txt | cat -A




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

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

Previous Next


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