On 01/05/2024 15:28, Art Shelest via GNU coreutils Bug Reports wrote:
Good morning,
I am seeing an aberrant behavior from the /usr/bin/paste utility when working
with Windows-style CR/LF text files.
The repro is for Mint Mate (Virginia).
If I change the line endings in the first file to Unix format (LF), it works as
expected.
If I change the line endings to Max (CR), it breaks even worse.
$ hexdump -C letters.txt
00000000 61 61 09 41 41 0d 0a 62 62 09 42 42 0d 0a |aa.AA..bb.BB..|
$ cat letters.txt
aa AA
bb BB
$ cat numbers.txt
1
2
$ paste letters.txt numbers.txt
aa 1A
bb 2B
$
Expected:
$ paste letters.txt numbers.txt
aa AA 1
bb BB 2
Thank you.
paste(1) is treating the CR like a standard character,
and when outputting that back to the terminal it "messes up" the expected
output.
I suggest you convert any such files to unix format before processing.
thanks,
Pádraig