|
|
|
|
|
by Joker_vD
1435 days ago
|
|
I think bash actually sends just "\n", the LF-to-CRLF translation is handled in the tty driver (it used to be part of the kernel, but no longer. Funny how Linux still has to translate text to use the so-called "Microsoft line endings" when it comes to terminals). |
|
CR - carriage return - escaped as \r - move the carriage to the beginning of the line (the "carriage" is the print head of a line printer, think an old dot-matrix or a typewriter)
LF - line feed - escaped as \n - advance the paper one line.
Since all on-screen terminals are "virtual", these are translated to cursor movements. But their origin is in paper output.
...it's because the \n LF line separators in the output aren't being translated to terminal instructions, just dumped raw.MS decided that both should be kept in text files; Unix-ish dropped the carriage return to use \n; MacOS before OSX used only \r.