You would like to find out which end of line characters are used in a file. Run a command similar to the following:
|
1 |
head -1 myfile | od -ta |
For a DOS file, you get:
|
1 |
0000000 m y l i n e cr nl |
For a UNIX file, you get:
|
1 |
0000000 m y l i n e nl |
Where cr is a carriage return (\r), and nl is a newline (\n).
Alternatively,
|
1 |
head -1 myfile | od -c |
gives the slightly more logical output of
|
1 |
0000000 m y l i n e \r \n |
for a DOS file, or
|
1 |
0000000 m y l i n e \n |
for a UNIX file.
Mac files terminate with \r only.