From owner-freebsd-questions Mon Sep 23 23:27:17 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id XAA18874 for questions-outgoing; Mon, 23 Sep 1996 23:27:17 -0700 (PDT) Received: from wedge.its.utas.edu.au (cp_nairn@wedge.its.utas.edu.au [131.217.10.10]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id XAA18651 for ; Mon, 23 Sep 1996 23:26:53 -0700 (PDT) Received: (from cp_nairn@localhost) by wedge.its.utas.edu.au (8.7.6/8.6.6) id QAA09973; Tue, 24 Sep 1996 16:26:32 +1000 (EST) Date: Tue, 24 Sep 1996 16:26:30 +1000 (EST) From: Carey Nairn X-Sender: cp_nairn@wedge.its.utas.edu.au Reply-To: Carey.Nairn@its.utas.edu.au To: "Randall D. DuCharme" cc: questions@FreeBSD.org Subject: Re: MS-DOS text files in UNIX In-Reply-To: <324754C2.41C67EA6@nconnect.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk On Mon, 23 Sep 1996, Randall D. DuCharme wrote: > Greetings, > I've read numerous things about adding the CR-LF back into text files > for use with DOS, but what about the other way?? Is there a way to > remove > that annoying ^M from a DOS text file under FBSD? I've tried many > things > but nothing short of removing them one-by-one seems to work. > > Thanks > > Randy > How about this little perl script ------------------------------------------------------------- #!/usr/local/bin/perl -ni if (/\r$/) { chop; chop; print $_,"\n"; } else { print $_; print (STDERR "$ARGV[0]: Line does not need translation\n"); } ------------------------------------------------------------- Cheers, Carey ========================================================================= Carey Nairn ! email : Carey.Nairn@its.utas.edu.au Infrastructure Services ! phone : (03) 6226 7419 Information Technology Services ! fax : (03) 6226 7898 University of Tasmania. ! int'l : (+61 3) =========================================================================