#982208 coreutils: cat -E, --show-ends display strangely when CR (\ r) is included.

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
KenichiroMATOHARA
Date:
2021-02-09 23:12:02 UTC
Severity:
minor
#982208#5
Date:
2021-02-07 13:08:31 UTC
From:
To:
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

- `-E, --show-ends` option

- `-A, --show-all` option

#982208#10
Date:
2021-02-09 23:01:07 UTC
From:
To:
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

#982208#15
Date:
2021-02-09 23:07:55 UTC
From:
To:
On Tue, Feb 9, 2021 at 3:01 PM Pádraig Brady <P@draigbrady.com> wrote:
...

+1 patch looks fine. Thanks!