[plug] Does anyone know where i can get source for dos2unix?

John Summerfield summer at os2.ami.com.au
Tue Jun 1 22:07:50 WST 1999


> Leon Brooks wrote:
> 
> > I can shorten it considerably:
> > 
> > tr -d '\r' <infile >outfile
> 
> This was always the better way - Perl is just more fun. :)
> 
> > Recursive version:
> > for file in $(find .); do tr -d '\r' <$file >/tmp/trimmed; mv -f
> > /tmp/trimmed $file; done
> 
> I wouldn't recommend running this as root.  Actually, I wouldn't
> recommend running this at all. :)

I do dry runs first to see what's being hit. I usually have a backup too: 
a preliminary tar is a good thing to promote that feeling of safety.

> A safer way would probably be to use find with -exec and tr (although I
> haven't tried this I expect it could be done) or use my original script.

mine's more general & can fix more than dos-format text files. For 
example, I did something of the kind when I moved my web pages from Iinet 
to Amisoft. Same again when I found broken hrefs.

-- 
Cheers
John Summerfield
http://os2.ami.com.au/os2/ for OS/2 support.
Configuration, networking, combined IBM ftpsites index.




More information about the plug mailing list