tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dg B" <dbret...@hotmail.com>
Subject Re: ^M characters
Date Fri, 01 Sep 2000 17:00:28 GMT

>
>I downloaded the Tomcat & tried to install it on a Unix computer.  I
>uncompressed and untarred the file, jakarta-tomcat.tar.gz.  When I opened
>any conf files or Java source files with vi editor, I saw the ^M characters
>on every line.  I am wondering whether I downloaded the wrong file.  How 
>can
>I get a 'clean' version without any '^M's for my Unix environment?
>
>Thanks for any help.
>

Hi Phil,

  You could write a Perl script to clean it up:

#!/perl/bin/perl

$filename = shift;   //get from input param
$foo = "/tmp/foo";

open(F,<$filename) or die "ouch";
open(F2,>$foo) or die "ouch2";

while(<F>) {
   $_ =~ s/'^M'//g;   //or maybe this... $_ =~ s/'^M'/'\n'/g;
   print(F2,$_);
}
rename($filename,$foo);


I hope this helps...
-Dennis
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Mime
View raw message