[Bug 696688] Re: grep --color= outputs blank line if \r in the input
schamane
696688 at bugs.launchpad.net
Mon May 27 17:12:32 UTC 2013
Related to
grep - Bugs: bug #25539, empty display with DOS newlines... [Savannah]
http://savannah.gnu.org/bugs/?25539
#456943 - grep: incorrect display with color and wrapping in some terminals - Debian Bug report logs
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=456943
** Bug watch added: GNU Savannah Bug Tracker #25539
http://savannah.gnu.org/bugs/?25539
** Bug watch added: Debian Bug tracker #456943
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=456943
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grep in Ubuntu.
https://bugs.launchpad.net/bugs/696688
Title:
grep --color= outputs blank line if \r in the input
Status in “grep” package in Ubuntu:
Confirmed
Bug description:
Binary package hint: grep
I expect the --color= option in grep to color the match. Instead,
grep --color= shows a blank line when \r is in the input.
For example,
$ echo -ne "foo\n" | \grep --color=always '^f.*'
foo
$ echo -ne "foo\r\n" | \grep --color=always '^f.*'
$ echo -ne "foo\r\n" | \grep --color=always '^f.*' | od -bc
0000000 033 133 060 061 073 063 061 155 033 133 113 146 157 157 015 033
033 [ 0 1 ; 3 1 m 033 [ K f o o \r 033
0000020 133 155 033 133 113 012
[ m 033 [ K \n
0000026
grep does find and color the content. It's just not visible.
Removing the \r, even after adding color, displays the line.
$ echo -ne "foo\r\n" | \grep --color=always '^f.*' | tr -d '\r'
foo
$ grep --version
GNU grep 2.5.4
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1 LTS
Release: 10.04
Codename: lucid
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grep/+bug/696688/+subscriptions
More information about the foundations-bugs
mailing list