Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!ll-xn!vlsi!malpass From: malpass@vlsi.ll.mit.edu (Don Malpass) Newsgroups: comp.sys.ibm.pc Subject: Re: Text file conversion between UNIX and MSDOS Summary: unix strip_cr script Message-ID: <273@vlsi.ll.mit.edu> Date: 21 Feb 89 15:58:07 GMT References: <89Feb9.123853est.2662@godzilla.eecg.toronto.edu> <368@dvnspc1.Dev.Unisys.COM> Reply-To: malpass@ll-vlsi.arpa.UUCP (Don Malpass) Distribution: na Organization: MIT Lincoln Laboratory, Lexington MA Lines: 21 >> Can somebody send me a program to do this? Like everyone else, I've been annoyed (and our unix laser printer gets annoyed) by the DOS which tags along with the in dos-originated files. Unix's "tr" (translate character) program provides the easiest solution when in unix. I put a script called "strip_cr" in my bin directory because I've needed to use it so often. It discards any in the called file, parks the stripped copy in /tmp, and renames it back to the original file. If you need wildcard expansion or multiple files, write a "foreach" script. # strip_cr: discards leaving only . echo 'NOT a pipe. Renames output back to input.' tr -d '\015' < "$1" >! /usr/tmp/dm.temp mv /usr/tmp/dm.temp "$1" -- Don Malpass [malpass@LL-vlsi.arpa], [malpass@gandalf.ll.mit.edu] A flush beats a full house. Plumber's Motto