Acknowledgement sent
to KenichiroMATOHARA <[email protected]>:
New Bug report received and forwarded. Copy sent to Michael Stone <[email protected]>.
(Sun, 07 Feb 2021 13:12:04 GMT) (full text, mbox, link).
Subject: coreutils: cat -E, --show-ends display strangely when CR (\ r) is included.
Date: Sun, 07 Feb 2021 22:08:31 +0900
Package: coreutils
Version: 8.32-4+b1
Severity: minor
Dear Maintainer,
When I create a text file with a newline code of "\r\n" and
`cat` with the `-E, --show-ends` option, "$" is displayed at
the beginning of the line.
When `-A, --show-all` is used, it looks normal.
- Create a file for \r\n
> $ echo 'foo
> > $ od -c dos.txt
> 0000000 f o o \r \n \t b a r \r \n
> 0000013
> bar' | tr '\n' '\r\n' > dos.txt
- `-E, --show-ends` option
> $ cat -E dos.txt
> $oo
> $ bar
> $ cat -nE dos.txt
> $ 1 foo
> $ 2 bar
- `-A, --show-all` option
> $ cat -A dos.txt
> foo ^M$
> ^Ibar^M$
> $ cat -nA dos.txt
> 1 foo^M$
> 2 ^Ibar^M$
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armhf, arm64
Kernel: Linux 5.10.0-3-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_CRAP, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages coreutils depends on:
ii libacl1 2.2.53-10
ii libattr1 1:2.4.48-6
ii libc6 2.31-9
ii libgmp10 2:6.2.1+dfsg-1
ii libselinux1 3.1-2+b2
coreutils recommends no packages.
coreutils suggests no packages.
-- no debconf information
Acknowledgement sent
to Pádraig Brady <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>.
(Tue, 09 Feb 2021 23:03:03 GMT) (full text, mbox, link).
On 07/02/2021 13:08, KenichiroMATOHARA wrote:
> Package: coreutils
> Version: 8.32-4+b1
> Severity: minor
>
> Dear Maintainer,
>
> When I create a text file with a newline code of "\r\n" and
> `cat` with the `-E, --show-ends` option, "$" is displayed at
> the beginning of the line.
> When `-A, --show-all` is used, it looks normal.
>
>
> - Create a file for \r\n
>> $ echo 'foo
>>> $ od -c dos.txt
>> 0000000 f o o \r \n \t b a r \r \n
>> 0000013
>> bar' | tr '\n' '\r\n' > dos.txt
>
> - `-E, --show-ends` option
>> $ cat -E dos.txt
>> $oo
>> $ bar
>> $ cat -nE dos.txt
>> $ 1 foo
>> $ 2 bar
>
> - `-A, --show-all` option
>> $ cat -A dos.txt
>> foo ^M$
>> ^Ibar^M$
>> $ cat -nA dos.txt
>> 1 foo^M$
>> 2 ^Ibar^M$
I agree the current behavior is less than useful because:
* \r\n is common a line end combination
* catting such a file without options causes it to display normally
* overwriting the first char with $, loses info
I propose to change the upstream coreutils project
as per the attached, to extend the --show-ends option
to show \r as ^M when the following character is \n.
thanks,
Pádraig
Acknowledgement sent
to Jim Meyering <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>.
(Tue, 09 Feb 2021 23:12:02 GMT) (full text, mbox, link).
Subject: Re: Bug#982208: coreutils: cat -E, --show-ends display strangely when
CR (\ r) is included.
Date: Tue, 9 Feb 2021 15:07:55 -0800
On Tue, Feb 9, 2021 at 3:01 PM Pádraig Brady <[email protected]> wrote:
...
> I agree the current behavior is less than useful because:
>
> * \r\n is common a line end combination
> * catting such a file without options causes it to display normally
> * overwriting the first char with $, loses info
>
> I propose to change the upstream coreutils project
> as per the attached, to extend the --show-ends option
> to show \r as ^M when the following character is \n.
+1 patch looks fine. Thanks!
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.