remove CR line terminators
Simple \r
terminators for newlines are "old Mac" line terminators, it is strange that an editor in 2012+ even generates files with such line terminators... Anyway, you can use the mac2unix
command, which is part of the dos2unix
distribution:
# Edits thefile inlinemac2unix thefile# Takes origfile as an input, outputs to dstfilemac2unix -n origfile dstfile
This command will not munge files which have already expected line terminators, which is a bonus. And the reverse (unix2mac
) also exists.
Note that mac2unix
is the same as dos2unix -c mac
.