From owner-freebsd-questions@FreeBSD.ORG Sun Jan 25 09:33:26 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 B245916A4CE for ; Sun, 25 Jan 2004 09:33:26 -0800 (PST) Received: from osiris.darksoulz.net (osiris.darksoulz.net [216.241.38.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id EAF0543D2D for ; Sun, 25 Jan 2004 09:33:24 -0800 (PST) (envelope-from blackice@darksoulz.net) Received: from localhost (localhost.darksoulz.net [127.0.0.1]) by osiris.darksoulz.net (Postfix) with ESMTP id 8CC208EA7; Sun, 25 Jan 2004 10:33:47 -0700 (MST) Received: from osiris.darksoulz.net ([127.0.0.1]) by localhost (osiris.darksoulz.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15857-05; Sun, 25 Jan 2004 10:33:35 -0700 (MST) Received: from mephisto.darksoulz.net (mephisto.darksoulz.net [10.0.0.2]) by osiris.darksoulz.net (Postfix) with ESMTP id D255E8EA3; Sun, 25 Jan 2004 10:33:34 -0700 (MST) Message-Id: <6.0.1.1.2.20040125103200.026dbce0@osiris.darksoulz.net> X-Sender: blackice@osiris.darksoulz.net X-Mailer: QUALCOMM Windows Eudora Version 6.0.1.1 Date: Sun, 25 Jan 2004 10:33:08 -0700 To: freebsd-questions@freebsd.org, misc@openbsd.org From: Eric Dyer In-Reply-To: <20040125162723.GQ672@griffon> References: <20040125151753.GA1798@gandalf.welch.net> <20040125162723.GQ672@griffon> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at osiris.darksoulz.net 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: Sun, 25 Jan 2004 17:33:26 -0000 One thing that works from the command line too col -bx < oldfile > newfile && mv newfile oldfile Picked that up from a freebsd box that had a freebsd-tips or something like that fortune file running on login At 09:27 AM 1/25/2004, Greg Wooledge wrote: >If *every* line ends with ^M (which is almost always going to be the >case, if the file has been produced on a DOS/Windows system), then >you can just use this: > >:%s/.$// > >to delete the last character of each line. This has an obvious >downside, but the advantages are that it's easier to type and to >read. > >-- >Greg Wooledge | "Truth belongs to everybody." >greg@wooledge.org | - The Red Hot Chili Peppers >http://wooledge.org/~greg/ | > >[demime 0.98d removed an attachment of type application/pgp-signature >which had a name of signature.asc]