From owner-freebsd-questions Tue Sep 24 08:33:10 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA27421 for questions-outgoing; Tue, 24 Sep 1996 08:33:10 -0700 (PDT) Received: from agora.rdrop.com (root@agora.rdrop.com [199.2.210.241]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id IAA27397 for ; Tue, 24 Sep 1996 08:33:01 -0700 (PDT) Received: from ime.net by agora.rdrop.com with smtp (Smail3.1.29.1 #17) id m0v5ZTl-0008ywC; Tue, 24 Sep 96 08:32 PDT Received: from kimiko.cguy.com (buxton-17.ime.net [206.231.148.146]) by ime.net (8.7.4/8.6.12) with ESMTP id LAA22286; Tue, 24 Sep 1996 11:32:13 -0400 (EDT) Message-Id: <199609241532.LAA22286@ime.net> From: "Gary Chrysler" To: "Randall D. DuCharme" , Subject: Re: MS-DOS text files in UNIX Date: Tue, 24 Sep 1996 11:31:50 -0400 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-questions@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk -=-=-=-=-=-=-=-=- CUT unix2dos.pl #!/usr/bin/perl -pi # # Convert Unix text file to DOS file format. Conversion is done in-place. # # Usage: unix2dos unixfile ... print STDERR "Converting \"$ARGV\" ...\n" if (eof || ($. == 0)); s/$/\015/; # tack on ^M s/\n/\n\032/ if (eof); # DOS ^Z at end of file. -=-=-=-=-=-=-=-=- CUT unix2dos.pl -=-=-=-=-=-=-=-=- CUT dos2unix.pl #!/usr/bin/perl -pi # # Convert DOS text file to Unix file format. Conversion is done in-place. # # Usage: dos2unix dosfile ... print STDERR "Converting \"$ARGV\" ...\n" if (eof || ($. == 0)); s/\015$//; # strip ^M from end of line. s/\032$//; # strip ^Z if we see it (which'll be at EOF). -=-=-=-=-=-=-=-=- CUT dos2unix.pl here is a couple of perl scripts that I use! I forgot who wrote em, I sure do thank em! -Enjoy Gary ~~~~~~~~~~~~~~~~ Improve America's Knowledge... Share yours The Borg... Where minds meet (207) 929-3848 ---------- > From: Randall D. DuCharme > To: questions@FreeBSD.org > Subject: MS-DOS text files in UNIX > Date: Monday, September 23, 1996 11:25 PM > > 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