Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Whats a DOS format text file?

dos file format text
0
Posted

Whats a DOS format text file?

0

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.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123