Whats a DOS format text file?
It has to do with the characters used to end lines. There are two that may be used: • Line Feed: (LF) Octal:012 Decimal:10 Hex:0A C Style Escape:’\n’ Moves down one line. • Carriage Return: (CR) Octal:015 Decimal:13 Hex:0D C Style Excape:’\r’ Move to the left margin. Unix, DOS, and MacOS each use a different combination to end lines in text files: • Unix: LF only. This is why when a Unix format text file is sent to a printer raw, it prints out like stairs steps. • DOS: CRLF both. Which is why if you do “cat -v” on a DOS file you’ll see a “^M” (control m is carriage return) at the end of each line. And that is why scripts don’t work when written with Microsoft Notepad. The kernel looks for “/bin/sh^M” which doesn’t exist. There’s a “/bin/sh”, but nothing with a “^M” appended. • MacOs: CR only. Printers probably print every line atop the first, and Unix tools think the whole file is one line with “^M” all through it.