From owner-freebsd-questions Wed May 8 10:32:16 2002 Delivered-To: freebsd-questions@freebsd.org Received: from intergate.sdccd.cc.ca.us (intergate.sdccd.cc.ca.us [209.129.16.2]) by hub.freebsd.org (Postfix) with ESMTP id C61A437B400 for ; Wed, 8 May 2002 10:32:08 -0700 (PDT) Received: from ntxdistrict.sdccd.cc.ca.us (ntxdistrict.sdccd.cc.ca.us [10.1.100.1]) by intergate.sdccd.cc.ca.us (8.9.1a/8.9.1) with ESMTP id KAA04709; Wed, 8 May 2002 10:27:23 -0700 (PDT) Received: by ntxdistrict.sdccd.cc.ca.us with Internet Mail Service (5.5.2654.89) id ; Wed, 8 May 2002 10:29:42 -0700 Message-ID: From: Erin Fortenberry To: "'Philip Southam'" , scottro@despammed.com Cc: shubhamr@malkauns.nsc.com, questions@FreeBSD.ORG Subject: RE: such a pain Date: Wed, 8 May 2002 10:29:34 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2654.89) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > > Hi, > > > I have some .c files which I got from my windows > machine.But when I read > > > it on BSD,for every line end ^M shows up,whereever there is a > > > newline(carriage return).It is tedious to remove them > manually.I have no > > > X installed on my BSD.Can anyone suggest how to get rid of them? > > > > > > shubha > > > > In BSD, open the file with the vi editor > > > > vi > > > > Once you have it there type > > > > :%s/ctrl +V ctrl+ M//g > > > > That will do it. > > The ctrl + V tells it to enter the next character > > literally---otherwise, the ctrl + M wouldn't show up. > > You may also want to try dos2unix, it's worked to remove > those pesky ^M's for me. > > #dos2unix file.txt > > It's located in /usr/ports/converters/unix2dos/ Next time, when you FTP them , send them in ASCII mode. By default most windows FTP clients send files in Binary mode. This has nothing to do with the files being binary or ASCII text, rather the FTP clients will strip the "/r" or carriage return from the end of the line for you. Erin Erin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message