From: dj AT delorie DOT com (DJ Delorie) Subject: Re: using cat on binary files (CTRL-Z trauma) 30 Oct 1996 10:49:26 -0800 Sender: daemon AT cygnus DOT com Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199610301324.IAA21663.cygnus.gnu-win32@delorie.com> Original-To: jqb AT netcom DOT com Original-CC: gnu-win32 AT cygnus DOT com In-reply-to: <199610300503.VAA10507@netcom23.netcom.com> (jqb@netcom.com) Original-Sender: owner-gnu-win32 AT cygnus DOT com > > If you want to know why CRLF is the standard, try this command on a unix > > box: > > > > stty -onlcr -icrnl > > > > Note that MS-DOS does not have, nor has ever needed, an stty command. > > Funny, but my unix system continues to run even when I delete this command > from the disk. Try deleting the corresponding function out of your shared libc, and I think you'll find it hard to log in. stty isn't normally needed because getty does it for you, but the default is to convert CRs and LFs in both directions. In order to claim that you don't need stty (or its functionality), you must first disable all the conversions that stty has set up for you when you logged in. > stty has nothing to do with how lines are stored in files. Yes, it does, sort of. If you run "cat file" or "lpr file" and you don't convert to CR/LF on the way, you can't read the output easily because there are no carriage returns. In the ancient days, CP/M (and its predecessors) stored the CR right in the file so that when it was printed or sent to the screen (heck, in the old days, your screen *was* a printer), the CRs were there to move the print carriage back to the left margin. Thus, the files had both CR and LF because they needed those control characters to control the printer. Since Unix doesn't store the right control characters in the file, it must allow the user to specify how newlines are to be converted for their terminals. Need a CR? Use "stty onlcr". Don't support lower case? Use "stty olcul". Return key generates CR instead of LF? Use "stty icrnl". Personally, I think they should have added a separate NL control code, that meant CR/LF, but they didn't. - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".