Skip site navigation (1)Skip section navigation (2)
Date:      07 Jun 2001 21:25:39 EST
From:      "Mark Sergeant" <msergeant@snsonline.net>
To:        Jason Oakley <waulok@bangrocks.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: __ how to eliminate "^M" in ASCII files.
Message-ID:  <200106080225.f582Peh25860@xyzzy.intranet.snsonline.net>
In-Reply-To: <Pine.BSF.4.21.0106081219460.27417-100000@snsonline.net>
References:  <Pine.BSF.4.21.0106081219460.27417-100000@snsonline.net>

next in thread | previous in thread | raw e-mail | index | archive | help
I use this...

#!/bin/sh
echo ""
echo "Removing Windows silly ^M's for the following files..."
echo ""
for file in $*; do
	echo ---- $file
	tr -d "\015" < $file > $file.$$
	cp $file.$$ $file
	rm -f $file.$$
done
echo ""
exit 0

Works wonderfully and can do many files at once.

Cheers,

Mark

On Fri, 8 Jun 2001 12:20:38 +1000 (EST), Jason Oakley said:

> save them with UNIX line ends (A handy feature of Arachnophilia
>  www.arachnoid.com).  Or do a search and replace in your favourite text
>  editor.
>  
>  VI:
>  
>  %s/^V^M//g
>  
>  
>  On Fri, 8 Jun 2001, bsdnewbie bsdnewbie wrote:
>  
>  ]:Is there any tool can eliminate "^M" in text files?
>  ]:Thanks in advance.
>  ]:
>  ]:best regards,
>  ]:steven
>  ]:_________________________________________________________________________
>  ]:Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>  ]:
>  ]:
>  ]:To Unsubscribe: send mail to majordomo@FreeBSD.org
>  ]:with "unsubscribe freebsd-questions" in the body of the message
>  ]:
>  
>  
>  ----------------------------
>  You should be Banging Rocks!
>    http://www.bangrocks.com
>               _
>           .oO(_)Oo.
>  
>    I'd far rather be happy
>      than right, any day.
>  
>  
>  To Unsubscribe: send mail to majordomo@FreeBSD.org
>  with "unsubscribe freebsd-questions" in the body of the message
>  
>  

-- 
Mark Sergeant
Unix Systems Administrator

Fortune follows...

Chicago Transit Authority Rider's Rule #36:
	Never ever ask the tough looking gentleman wearing El Rukn
headgear where he got his "pyramid powered pizza warmer".
		-- Chicago Reader 3/27/81



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106080225.f582Peh25860>