Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Unix >< DOS text converter


This one time, at band camp, Bernhard L?der wrote:
>Hi,
>
>can anyone recommend a text file converter running on Windows, that converts
>DOS into Linux/UNIX and vice versa?

There used to be a command called 'fromdos' on Slackware machines, but
that's merely a wrapper around tr(1).

pipe the file through tr -d '\r', it'll strip carriage return characters and
leave the linefeed.  Although that's not technically correct, you may want
something like sed 's/\r\n/\n/' but last time I checked, sed doesn't support
newline characters in regexs.

-- 
jaq@xxxxxxxxxxxxxx                        http://spacepants.org/jaq.gpg
<Balial> This port may thing it's fortified, butt I seem to be mounting
a pretty good assault