From: jjf AT dsbc DOT icl DOT co DOT uk (J.J.Farrell) Subject: Re: using cat on binary files (CTRL-Z trauma) 31 Oct 1996 17:34:28 -0800 Sender: daemon AT cygnus DOT com Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199610312042.14110.0.cygnus.gnu-win32@dsbc.icl.co.uk> Content-Type: text Original-To: dj AT delorie DOT com (DJ Delorie) Original-Cc: jqb AT netcom DOT com, gnu-win32 AT cygnus DOT com In-Reply-To: <199610301324.IAA21663@delorie.com> from "DJ Delorie" at Oct 30, 96 08:24:41 am X-Mailer: ELM [version 2.4 PL23] Content-Length: 1346 Original-Sender: owner-gnu-win32 AT cygnus DOT com > From: DJ Delorie > > 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. I'm not sure that there is a concept of 'the right control characters' in UNIX. UNIX has chosen to use a particular control character to indicate the end of a 'line', and it is up to programs (in the widest sense) to recognise it and interpret it appropriately. With this philosophy, it is sensible to use a single character rather than two since it uses less space. It doesn't matter what that character is, and they chose to use linefeed. This was perhaps an unfortunate choice since it is related to what needs to be sent to terminals and printers at the end of each line, and sometimes causes confusion (as now). It's best to think of it as an arbitrary character used to indicate the end of a line; once programs have used it to find the end of the line, they logically discard it and do whatever end-of-line processing is needed, such as sending CR/LF to the terminal. Regards, jjf - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".