tags 17032 + notabug thanks On Mon, Mar 17, 2014 at 9:41 PM, Roméo Capulet <[email protected]> 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
