From owner-freebsd-questions@FreeBSD.ORG Tue Dec 2 18:32:37 2003 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 674AA16A4CE for ; Tue, 2 Dec 2003 18:32:37 -0800 (PST) Received: from post.web.ca (post.web.ca [192.139.37.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id 820DD43FBD for ; Tue, 2 Dec 2003 18:32:36 -0800 (PST) (envelope-from rob@web.ca) Received: by post.web.ca (Postfix, from userid 1001) id 848C25D4D; Tue, 2 Dec 2003 21:32:35 -0500 (EST) Date: Tue, 2 Dec 2003 21:32:35 -0500 From: Rob Ellis To: freebsd-questions@freebsd.org Message-ID: <20031203023235.GB88571@web.ca> Mail-Followup-To: Rob Ellis , freebsd-questions@freebsd.org References: <20031201031602.GA80581@bsdjunky.homeunix.org> <20031202225359.GA1125@moo.holy.cow> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031202225359.GA1125@moo.holy.cow> User-Agent: Mutt/1.4.1i Subject: Re: Remove ^M characters from xhtml file 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: Wed, 03 Dec 2003 02:32:37 -0000 On Tue, Dec 02, 2003 at 05:53:59PM -0500, parv wrote: > in message <20031201031602.GA80581@bsdjunky.homeunix.org>, > wrote Bryan Cassidy thusly... > > > > I've downloaded a couple of .xhtml files and they have ^M characters > > all through it. I tried the col -b < name > newname command on these > > files but when I do that it erases the whole document. Any ideas? > > Ah, a FAQ of comp.unix.* groups... > > http://groups.google.com/groups?q=remove+%22%5EM%22+file+group%3Acomp.unix.* > > > It pains me not to see even a mention of sed, even though i prefer the > "perl pie" solution myself. To rectify the situation... > > # one way to type ^M is: Ctrl-V followed by Ctrl-M > sed -e 's/^M$//' old > new && mv -f new old > Freebsd's sed has -i sed -ie 's/^M$//' old - Rob