Format of options file

Ralph Corderoy ralph at inputplus.co.uk
Mon Mar 5 05:36:49 PST 2018


Hi MacFH,

> 'Carriage Return', CR, meant precisely that  -  in other words, move
> the slidable teleprinter carriage holding the paper to the right so
> that the fixed print head is at the left margin position.  LineFeed,
> LF, also meant exactly that, rotate the carriage roller to move the
> printing position to the next line.

Those of us that used manual typewriters, that pre-date fangled
teleprinters, will recognise the two actions that could be done by the
lever to the left.  It would feed the paper to the next line when
pressed, and when continued to be pushed it would slide the carriage
along so it returned to the start.  It was the `Line feed/Carriage
return lever'.

> Arguably the oddballs are Linux and perhaps Macs, using only one. 
> This would mean that if their text was sent directly to a teleprinter,
> the output would not be what is required, but of course these days
> that would seldom if ever be done.

But in those days of Multics and Unix that's precisely what was done
with Unix text files, terminated by just LF, and yet the text didn't
stagger across the page because a device driver was correctly the thing
that knew what a particular device needed to be sent as bytes;  the file
format wasn't the place for that.  Other characteristics include a
timing delay to allow for the carriage to return before sending more
bytes.

> Linux could be argued to have subverted both codes, because not only
> does a LF move the cursor to the next line of text, but an implicit CR
> is also performed

This happens in a terminal window for the same reason it happens on a
teleprinter;  the TTY is so configured and the device driver obeys.  I
can say this particular device doesn't need a CR sent to it before every
LF.

    $ stty onlcr; printf 'foo\nbar\n'; stty -onlcr; printf 'foo\nbar\n'
    foo
    bar
    foo
       bar
	  $

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



More information about the get_iplayer mailing list