Subject: Re: using cat on binary files (CTRL-Z trauma)
From: [email-masked] (J.J.Farrell)

31 Oct 1996 17:34:28 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Content-Type: text
Original-To: [email-masked] (DJ Delorie)
Original-Cc: [email-masked], [email-masked]
In-Reply-To: <[email-masked]> from "DJ Delorie" at Oct 30, 96 08:24:41 am
X-Mailer: ELM [version 2.4 PL23]
Content-Length: 1346      
Original-Sender: [email-masked]

> From: DJ Delorie <[email-masked]>
> 
> 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
"[email-masked]" with one line of text: "help".