From owner-freebsd-questions Sat Aug 30 15:14:08 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id PAA05061 for questions-outgoing; Sat, 30 Aug 1997 15:14:08 -0700 (PDT) Received: from ot.stpn.soft.net (freebie.opentech.stpn.soft.net [204.143.126.74]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id PAA05053 for ; Sat, 30 Aug 1997 15:14:03 -0700 (PDT) Received: from andes (andes.opentech.stpn.soft.net [204.143.126.66]) by ot.stpn.soft.net (8.6.12/8.6.12) with ESMTP id DAA00866; Sun, 31 Aug 1997 03:46:04 +0530 Message-ID: <34092E34.2528FC84@opentech.stpn.soft.net> Date: Sun, 31 Aug 1997 03:41:24 -0500 From: Prashant Dongre Reply-To: pdongre@opentech.stpn.soft.net X-Mailer: Mozilla 4.01 [en] (WinNT; I) MIME-Version: 1.0 To: Edwin Culp CC: gkshenaut@ucdavis.edu, questions@FreeBSD.ORG Subject: Re: Stripping ^M from llines? X-Priority: 3 (Normal) References: <199708300228.TAA05602@myrtle.bogs.org> <34082117.10820BBF@mexcom.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Edwin Culp wrote: > Greg Shenaut wrote: > > > > In message <34076F58.B5DBAC3F@chalmers.com.au>, Robert Chalmers cleopede: > > >Hi, > > >Anyone got a handy program for stripping the ^M from text > > >lines in fbsd? > > > > Try this C program (fixnl). Maybe it'll work. > > (I use it on BSD/OS and MS-DOS, but haven't tried it > > on fbsd.) It is gzipped and uuencoded. > > > I would suggest something a little simpler. > sed 's/^M$//' filename>filename.tmp > mv filename.tmp filename > The ^M is done with the vi editor first typing > control v followed by a control m. > > This can obviously be put in a simple shell program > to solve the problem forever:-) > > ed I think this is most sensible in using whatever is already there..... No separate 'C' or Perl program to this as simple as that.... Prashant.