bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12052: grep carriage return conflicts with output color highlighting


From: Judson Wilson
Subject: bug#12052: grep carriage return conflicts with output color highlighting
Date: Wed, 25 Jul 2012 16:34:45 -0700

I had trouble grepping carriage returns (grep $'\r' ) until I realized the
lines were printing blank.

If I grep something else on the line, the line prints fine. Putting 1 and 1
together I figured it was
the result highlighting conflicting with the carriage return color, and I
was able to get it to
work using --color=never.

test case:

address@hidden ~]$ echo $'a\nb\r\n\c\n' > carriage.txt
address@hidden ~]$ grep 'b' carriage.txt
b
address@hidden ~]$ grep $'\r' carriage.txt

address@hidden ~]$ grep --color=never $'\r' carriage.txt
b

As for my versions:

address@hidden ~]$ grep -V
grep (GNU grep) 2.9
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see <
http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.

address@hidden ~]$ uname -r
2.6.43.8-1.fc15.i686


reply via email to

[Prev in Thread] Current Thread [Next in Thread]