GNU bug report logs -
#12052
grep carriage return conflicts with output color highlighting
Previous Next
Reported by: Judson Wilson <wilson.judson <at> gmail.com>
Date: Thu, 26 Jul 2012 01:17:03 UTC
Severity: normal
Tags: notabug
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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:
[judson <at> localhost ~]$ echo $'a\nb\r\n\c\n' > carriage.txt
[judson <at> localhost ~]$ grep 'b' carriage.txt
b
[judson <at> localhost ~]$ grep $'\r' carriage.txt
[judson <at> localhost ~]$ grep --color=never $'\r' carriage.txt
b
As for my versions:
[judson <at> localhost ~]$ 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>.
[judson <at> localhost ~]$ uname -r
2.6.43.8-1.fc15.i686
[Message part 2 (text/html, inline)]
This bug report was last modified 6 years and 222 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.