The reason file1
has \r\n
line endings, as you can see in the dump xxd
:
312030203020302030203020302030200d0a312031203120312030203020...
^^^^
here
You know that the line ends because \r == 13 == 0x0d
and \n == 10 == 0x0a
.
So, the command paste
does not know about \r
before the end of the line, so it allows the end of each line from file1
, but when you look at the contents file3
you use a program that interprets \r
as the end of the line.
, \n
:
cat file1 | tr -d '\r' > file1-output
, dos2unix
:
dos2unix file1