Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!wuarchive!emory!gatech!ncar!ico!rcd From: rcd@ico.isc.com (Dick Dunn) Newsgroups: comp.unix.sysv386 Subject: Re: Converting DOS text files Summary: doing it UNIX-style would be a lot easier... Keywords: SCO ODT Message-ID: <1990Oct16.191059.937@ico.isc.com> Date: 16 Oct 90 19:10:59 GMT References: <1477@pai.UUCP> Organization: Interactive Systems Corporation, Boulder, CO Lines: 37 erc@pai.UUCP (Eric Johnson) writes about converting DOS text files (with CR-LF line terminators and final ^Z) for UNIX. > ...On SCO, there is a program to take care of this, called > dtox... Much to my surprise, he's right that SCO really did make it a program. Back in the days of UNIX, we would have used one of the little filter programs (like tr or sed) that came with the system. Oh well, "forward into the past" and "programmer's full employment" and all that. >...Unfortunately, dtox is a filter. That is, you call it > with something like: > > dtox dosfile > unixfile Why is that a problem? A filter is just slightly more general: You can apply a filter to files; a program written to handle only files can't be used in a pipe sequence. But let's forge ahead... > This is nice, but I have a big problem. I have 30 to 40 files I > want to un-DOS at a time. I want to be able to type something > like > undos *.txt A big problem? Why not (in sh notation): for f in *.txt do cp $f /tmp/d$$ dtox /tmp/d$$ >$f done rm /tmp/d$$ or go all the way to a UNIX approach and replace the dtox line with tr -d '\015\032' $f -- Dick Dunn rcd@ico.isc.com -or- ico!rcd Boulder, CO (303)449-2870 ...Never offend with style when you can offend with substance.