From unknown Sun Jun 22 03:59:32 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12052: grep carriage return conflicts with output color highlighting Resent-From: Judson Wilson Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 26 Jul 2012 01:17:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12052 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 12052@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.134326539912999 (code B ref -1); Thu, 26 Jul 2012 01:17:03 +0000 Received: (at submit) by debbugs.gnu.org; 26 Jul 2012 01:16:39 +0000 Received: from localhost ([127.0.0.1]:39946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SuCgx-0003NX-1c for submit@debbugs.gnu.org; Wed, 25 Jul 2012 21:16:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57591) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SuBD0-0001BV-G2 for submit@debbugs.gnu.org; Wed, 25 Jul 2012 19:41:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuB6P-0004Ql-Ek for submit@debbugs.gnu.org; Wed, 25 Jul 2012 19:34:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:35055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuB6P-0004Qh-BE for submit@debbugs.gnu.org; Wed, 25 Jul 2012 19:34:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuB6O-00059v-8Y for bug-coreutils@gnu.org; Wed, 25 Jul 2012 19:34:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuB6N-0004QX-4j for bug-coreutils@gnu.org; Wed, 25 Jul 2012 19:34:48 -0400 Received: from mail-yw0-f41.google.com ([209.85.213.41]:61133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuB6N-0004QT-05 for bug-coreutils@gnu.org; Wed, 25 Jul 2012 19:34:47 -0400 Received: by yhr47 with SMTP id 47so1648469yhr.0 for ; Wed, 25 Jul 2012 16:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=nwHC6wN463WiyNE3am2ZuKqlYJkrziPWvJJ5Oa2U4i4=; b=wzcr1eYg/Trc6A1wsBULytoG+fdsP+eGN5kAeGIMAzuTbvRcN/9vg2uktgsy/F029O n3LOPaNQGvEHdvFC0sU5OUtRAeQJr60X66YqB+oMz3iuvCcCYP0v5v1X2sNtrnQXCIDF 7MzIeMlNx0eG1ilGhyPNaYApxhpRAQKQtw5U5sdbpFBgSznh4u3kpXtZ31cLyku6rg+9 RcpOP5PaVC9LMgwVbbsbFuqv+keGPEZRa0Tdl3NC99HcGjBdsfEjSPVxK8IKhI5jZLu3 iHJQVvJgw8QGq0K9lcYHege7WYFH/+ruuf4FN1ytpM3buAGQoIrNqIxrPTCb9TsfAguN 5Pow== MIME-Version: 1.0 Received: by 10.60.20.197 with SMTP id p5mr38063275oee.32.1343259285500; Wed, 25 Jul 2012 16:34:45 -0700 (PDT) Received: by 10.60.61.162 with HTTP; Wed, 25 Jul 2012 16:34:45 -0700 (PDT) Date: Wed, 25 Jul 2012 16:34:45 -0700 Message-ID: From: Judson Wilson Content-Type: multipart/alternative; boundary=e89a8ff1c7688db13404c5afeccf X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Mailman-Approved-At: Wed, 25 Jul 2012 21:16:36 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) --e89a8ff1c7688db13404c5afeccf Content-Type: text/plain; charset=ISO-8859-1 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@localhost ~]$ echo $'a\nb\r\n\c\n' > carriage.txt [judson@localhost ~]$ grep 'b' carriage.txt b [judson@localhost ~]$ grep $'\r' carriage.txt [judson@localhost ~]$ grep --color=never $'\r' carriage.txt b As for my versions: [judson@localhost ~]$ grep -V grep (GNU grep) 2.9 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . 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@localhost ~]$ uname -r 2.6.43.8-1.fc15.i686 --e89a8ff1c7688db13404c5afeccf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I had trouble grepping carriage returns (grep $'\r' ) until I=A0rea= lized=A0the lines were printing blank.=A0

If I grep some= thing else on the line, the line prints fine. Putting 1 and 1 together I fi= gured it was
the result highlighting conflicting with the carriage return color, an= d I was able to get it to
work using --color=3Dnever.

test case:

[judson@localhost ~]$ echo= $'a\nb\r\n\c\n' > carriage.txt
[judson@localhost ~]$ grep 'b' carriage.txt=A0
b
[judson@localhost ~]$ grep $'\r' carriage.txt=A0
<= br>
[judson@localhost ~]$ grep --color=3Dnever $'\r' carr= iage.txt=A0
b

As for my versions:
[judson@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 i= s free software: you are free to change and redistribute it.
Ther= e is NO WARRANTY, to the extent permitted by law.

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

[judson@localhost= ~]$ uname -r
2.6.43.8-1.fc15.i686




--e89a8ff1c7688db13404c5afeccf-- From unknown Sun Jun 22 03:59:32 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12052: grep carriage return conflicts with output color highlighting Resent-From: Assaf Gordon Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 15 Oct 2018 17:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12052 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 12052@debbugs.gnu.org Received: via spool by 12052-submit@debbugs.gnu.org id=B12052.15396248253534 (code B ref 12052); Mon, 15 Oct 2018 17:34:02 +0000 Received: (at 12052) by debbugs.gnu.org; 15 Oct 2018 17:33:45 +0000 Received: from localhost ([127.0.0.1]:51176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gC6kT-0000ur-Ir for submit@debbugs.gnu.org; Mon, 15 Oct 2018 13:33:45 -0400 Received: from mail-io1-f41.google.com ([209.85.166.41]:32900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gC6kP-0000uW-Gj; Mon, 15 Oct 2018 13:33:43 -0400 Received: by mail-io1-f41.google.com with SMTP id l25-v6so14798184ioj.0; Mon, 15 Oct 2018 10:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=935HksJo75H8WVJlX80YBH89J5Krhzg+vqmg/+ejhb4=; b=Vo+CllA3QLlx7QDJcz5LE7ehYPDtJ/Sdg7TZkvTaHQdVYJJTKXDlBPnnCUrSJuiPNO SDaevnKfXB/0TFwrP+87XUCPeeCeHghWtcIq7kB7oYlczWGukdEEsUFdIpK+gd4T6zNM 0sH88AasCZa+o15KnmDJdSRgSfgfd/uNhgA0WXfHWxyDnrGpWs11E9Yni4O3rrHGu/mB bq9+ArOXC9O2W+2U+ztyHIEtz/SW5VoQAgFHqfCRuTdSELLOKrJobcHoTZaQqcIXrm6a k02NJXuy/Lcp5bfHR7mYErhUKUKhKi/KKrgCrd08QiXNnv0Ds13bCGOj17eVyIYbHncL 2HnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=935HksJo75H8WVJlX80YBH89J5Krhzg+vqmg/+ejhb4=; b=IJVfc6bXCycWjJ6G9GDloKn07Qf+NfB/DKvGm5hDMHd1GDA8K6GKcsbb+yzmeIqS9Y gYr5Fj+LVCD9RAEL+hUlErsgQJCRjvDP6is+hr33pQw6k5VXtPv5GXwb5cYkWc1LoNiH t2c3LpymbpN1zJ2Bzw+iQTIpuIquC4Q7Z4gqBujFqAXr3GOk2PrZ/1F3EspFiC2zcjry faZxZzl//QxY5frwUQ6tFp0hcb7XDnKyRAws0A2kUec+zmHQNhMiWr8pKVydrBBQ+43f 9RKjiToTu2B2P+ITK6gqiwC56fBlfZpGHycq/Mcetceg4O57uxoLvbS/TkCdZJlG/KdU /R2A== X-Gm-Message-State: ABuFfohVG2fNcBHY1CTl+1W6A0EVU3yTGfqg4PmlfToxJxotgtLtrntX 9cU2gdkLiB+nLSIxxpLqx9Lc9a4dwiQ= X-Google-Smtp-Source: ACcGV6278oE2Alt7A9ws0SOyogF4q8KkrfWUeuSu6sHdRb/xCfZGXLMvm873r32+YnJTn+nQTqHFvQ== X-Received: by 2002:a6b:8b97:: with SMTP id n145-v6mr10503577iod.282.1539624815407; Mon, 15 Oct 2018 10:33:35 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id o194-v6sm5757571ito.11.2018.10.15.10.33.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 10:33:34 -0700 (PDT) References: From: Assaf Gordon Message-ID: <53129831-1d90-d9c3-e9b8-3adc1ca4f625@gmail.com> Date: Mon, 15 Oct 2018 11:33:33 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 12052 notabug close 12052 stop (triaging old bugs) On 25/07/12 05:34 PM, Judson Wilson wrote: > I had trouble grepping carriage returns (grep $'\r' ) until I realized the > lines were printing blank. > This is a 'grep' bug, but you wrote to "bugs-coreutils@gnu.org". If you still encounter this bug, please write to "bug-grep@gnu.org". As such, I'm closing this bug. regards, - assaf