Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Aug 2000 23:35:43 -0700
From:      Kent Stewart <kstewart@urx.com>
To:        Kisanak <kisanak@cbn.net.id>
Cc:        questions@FreeBSD.ORG
Subject:   Re: ^M
Message-ID:  <39924D3F.97F688F3@urx.com>
References:  <NEBBLICCKKPKJABLGBLMAEDECHAA.kisanak@cbn.net.id>

next in thread | previous in thread | raw e-mail | index | archive | help


Kisanak wrote:
> 
> Yes, I did ftping it in ASCII mode, but still doesn't work.
> Finally, it works with tr -d "\r" < test.txt > test2.txt
> 
> but it never works with:
> load the file with vi.  execute the following command...
> :1,$s,<CTL-V><CTL-M>,,g
> 
> It seems that there's no visual feature while editing
> using vi in freebsd, but in linux I can use visual or visual
> block features. any idea?.

Well, I transfered one of my Windows 2000 index.html's to my FreeBSD
system in binary mode and this is what I got.

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">^M
<html>^M
^M
        <head>^M
                <meta http-equiv="content-type"
content="text/html;charset=iso-8
859-1">^M
                <meta name="generator" content="Microsoft FrontPage
4.0">^M
                <title>Kent Stewart's Home Page</title>^M

There was a screen full of this. I thought that was visual mode :).

From col 1 on line one I typed in

:.,$s/^M//g

and my screen converted to

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>

        <head>
                <meta http-equiv="content-type"
content="text/html;charset=iso-8
859-1">
                <meta name="generator" content="Microsoft FrontPage
4.0">
                <title>Kent Stewart's Home Page</title>
                <meta name="VPSiteProject"
content="file:///C|/WEBSHARE/WWWROOT/

I don't have any idea what you did wrong at this point. The
<ctrl>v<ctrl>m produced the "^M" sequence, which then deleted all of
the <cr>'s in the file.

Kent

> 
> Thanks for any helps.
> regards,
> Kisanak.
> 
> -----Original Message-----
> From: Matthew Emmerton [mailto:matt@gsicomp.on.ca]
> 
> If you're FTPing the files, be sure to transfer them in ASCII mode.  This
> will enforce the proper end-of-line translation between DOS and UNIX.
> 
> Otherwise, use the following command to strip ^Ms:
> 
>  tr -d "\r" < test.txt > test2.txt
> 
> where "test.txt" is the file with the "^M" characters, and test2.txt is a
> new file without them.
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message

-- 
Kent Stewart
Richland, WA

mailto:kbstew99@hotmail.com
http://kstewart.urx.com/kstewart/index.html
FreeBSD News http://daily.daemonnews.org/

Bomber dropping fire retardant in front of Hanford Wild fire.
http://kstewart.urx.com/kstewart/bomber.jpg


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?39924D3F.97F688F3>