Jason Van Cleve wrote:

> Incidentally, I don't really mind the fact that sed won't acknowledge
> other, less perfect end-of-line conventions, assuming there is genuine
> value in so much pedantry.  I just think it would help to document that
> behavior explicitly, for I cannot be the first person to have bumped
> into this problem.  You apologists may say I had only to put two and two
> together:  to assume a particular treatment based on the unix
> convention.  But let's remember why we document things at all, to make
> them easier to learn and understand.

I agree, the man page should be more explicit.  The thing is, sed was
first written around 1975, the year of the first microprocessor, and
DOS did not exist then.  Other operating systems that used CR+LF to
terminate lines did, notably Digital's PDP-11 OSes.  (DEC had a
surprising number of OSes for the '11, and I'm not sure I could name
them all.)

But files didn't migrate from platform to platform so often then.  For
one thing, Ethernet hadn't been invented.  You could copy a file to a
tape and move the tape to the other machine, but that involved a whole
array of format issues, of which line termination was pretty minor.
(Remember EBCDIC?  Fixed-length records?)  The dd command is a pretty
good time capsule of the conversion issues of the day -- check out the
unblock option.

I'm just providing historical context here.

I agree that sed could stand to get with the program and have some
switches to work with foreign line formats.  I don't think it should
do that by default, because that would break things.

> I sense much hostility toward DOS newlines, a foolish relic from the
> days of dot-matrix printers, as I understand.

Typewriters, actually.  Nineteenth century technology.

If I sounded hostile, I apologize.  I wanted to defend sed for being
exactly what it is, because I knew where it had come from.

-- 
Bob Miller                              K<bob>
kbobsoft software consulting
http://kbobsoft.com                     [EMAIL PROTECTED]
_______________________________________________
EUGLUG mailing list
[email protected]
http://www.euglug.org/mailman/listinfo/euglug

Reply via email to