Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you've ever wondered why newlines are sometimes CR and other times CR+LF, I think Gary is part of that answer.


It's because on a terminal, CR moved the cursor to the left column and LF moved the cursor down one line. That was also true for dot matrix printers, and paper-based terminals like a modded IBM Selectric or the DecWriter.

So if you wanted your file to display properly when type'd to the console or pip'd to a printer, you needed CR,LF make it work. LF alone would give you text in a barber pole pattern, and CR alone would give you the last line of a file on a terminal, or a horrible mess of over strike text on a printer.


Ah, I remember those days. If someone made the mistake of just using CR alone in a big file they spooled to the lineprinter, it sometimes quite literally would halt and catch fire. There was a fire-extinguisher placed next to it for a reason.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: