From owner-freebsd-questions@FreeBSD.ORG Mon Dec 1 06:54:03 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 B39E016A4CE for ; Mon, 1 Dec 2003 06:54:03 -0800 (PST) Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.214]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D84643FE5 for ; Mon, 1 Dec 2003 06:54:02 -0800 (PST) (envelope-from simong@desktop-guardian.com) Received: from [81.174.227.186] (helo=desktop-guardian.com) by ptb-relay03.plus.net with smtp (Exim 4.24; FreeBSD 4.9) id 1AQpR2-0003TO-PU for freebsd-questions@freebsd.org; Mon, 01 Dec 2003 14:54:00 +0000 Received: (qmail 95258 invoked by uid 1006); 1 Dec 2003 14:57:29 -0000 Received: from simong@desktop-guardian.com by dtg25 by uid 82 with qmail-scanner-1.16 (clamscan: 0.54. spamassassin: 2.55. Clear:. Processed in 8.342972 secs); 01 Dec 2003 14:57:29 -0000 Received: from unknown (HELO dtg17) (192.168.0.17) by 192.168.0.25 with SMTP; 1 Dec 2003 14:57:17 -0000 Message-ID: <0d9f01c3b81a$b10a2b40$1100a8c0@dtg17> From: "Simon Gray" To: "Bryan Cassidy" , References: <20031201031602.GA80581@bsdjunky.homeunix.org> Date: Mon, 1 Dec 2003 14:52:06 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 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: Mon, 01 Dec 2003 14:54:03 -0000 > 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? handy little shell script i found a while ago which does exactly what you're after #!/bin/sh # rmc.sh # remove ^M characters # # slee 021116 # http://freebsd.mu if [ $# -eq 1 ] then tr -d '\015' < $1 > $1.tmp.$$ mv -f $1.tmp.$$ $1 else echo "Usage: $0 filename" fi Just place within /usr/local/bin and do 'chmod +x /usr/local/bin/rmc.sh' then just do 'rmc.sh file' as and when you need. HTH Simon