Subject: Re: CRLF fun stuff again...

From: "Tom Watson" <[email-masked]>
Date: Sun, 04 Feb 2001 00:57:54 -0800

On Sat, 3 Feb 2001 14:54:13 -0500 (EST), 
	Duncan Sinclair <[email-masked]> writes:
> Marc Miller writes:
<<<Marks deletia about why not>>>
<<<Duncan's deletia about why it should work>>>
> Duncan.

Geez folks, how about making a "simple" script like:

#!/bin/sh
tr "\015\012" "\012\015" $1 $$converted
rm $1
mv $$converted $1

And put it somewhere nice (/usr/local/bin) and give it a nice name.  It will
convert to & from mac endings (<cr>, \015) to Unix/Linux/HP-UX endings (<lf>,
\012).

If your favorite editor doesn't see the line endings, convert it, and then
use it, then convert it back.  This isn't rocket science.  Anyway, HTML
could care less about line endings anyway.  Be thankful you don't have
Windoze, they use TWO characters as line endings.

Further rant deleted by author.  It has been said all before.  No use
wasting bandwidth.  (*SIGH*)
-- 
Tom Watson         Generic short signature
[email-masked]     (I'm at home now)

---

From: Carsten Neumann <[email-masked]>
Date: Mon, 5 Feb 2001 01:44:32 +0100

> tr "\015\012" "\012\015" $1 $$converted

This one has some disadvantages:
1. My (gnu-)tr only reads from stdin and writes to stdout.
2. The file-name must not contain spaces - but Mac-files often do.
3. The permissions and dates are changed.

A better one:

#!/bin/sh
tr '\r\n' '\n\r' < "$1" > $$converted
touch --reference "$1" $$converted
chmod --reference "$1" $$converted
mv -f $$converted "$1"

> wasting bandwidth.  (*SIGH*)

Regards

	Carsten