Subject: bug#17032: closed (Re: bug#17032: side effect bug...)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 18 Mar 2014 16:01:03 +0000

Your bug report

#17032: side effect bug...

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 [email-masked].

-- 
17032: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17032
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#17032: side effect bug...
From: Jim Meyering <[email-masked]>
To: Roméo Capulet <[email-masked]>
Cc: [email-masked]
Date: Tue, 18 Mar 2014 08:59:39 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

tags 17032 + notabug
thanks

On Mon, Mar 17, 2014 at 9:41 PM, Roméo Capulet <[email-masked]> 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

Subject: side effect bug...
From: Roméo Capulet <[email-masked]>
To: [email-masked]
Date: Tue, 18 Mar 2014 05:41:15 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

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.