From owner-freebsd-questions@FreeBSD.ORG Mon Jan 26 07:11:20 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 313FD16A4CE for ; Mon, 26 Jan 2004 07:11:20 -0800 (PST) Received: from clunix.cl.msu.edu (clunix.cl.msu.edu [35.9.2.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id A634943D5D for ; Mon, 26 Jan 2004 07:11:15 -0800 (PST) (envelope-from jerrymc@clunix.cl.msu.edu) Received: (from jerrymc@localhost) by clunix.cl.msu.edu (8.11.7p1+Sun/8.11.7) id i0QFBAK14915; Mon, 26 Jan 2004 10:11:10 -0500 (EST) From: Jerry McAllister Message-Id: <200401261511.i0QFBAK14915@clunix.cl.msu.edu> To: chkrootkit@hotmail.com (marlon corleone) Date: Mon, 26 Jan 2004 10:11:09 -0500 (EST) In-Reply-To: from "marlon corleone" at Jan 25, 2004 09:43:21 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: misc@openbsd.org cc: freebsd-questions@freebsd.org Subject: Re: how to get rid of ^M character using vi X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jan 2004 15:11:20 -0000 > > how do i get rid of this annoying character ^M using vi, in pico i used the > arguments '-w' > but what about in vi? Those are extra carriage return characters generally displayed as CR or ^M or \r depending on which programmers convention is being used. There are lots of ways to strip then including those using vi and sed and perl, etc. The one I use which I find easiest is to run tr(1) THis is in FreeBSD standard. You don't have to install a port just for that like you do for some of the utilities that will do it. Check out the man page. Presuming your file is myfile.crs just do: tr -d "\r" < myfile.crs > myfile.fixed and it will remove (-d) all carriage return characters ("\r") and write the results to myfile.fixed. It will work for modifying other stuff across a whole file too. You just have to learn its idea of the right conventions for special characters (if it involves special characters). ////jerry > > cheers > > _________________________________________________________________ > MSN 8 with e-mail virus protection service: 2 months FREE* > http://join.msn.com/?page=features/virus > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >