how to get rid of ^M character using vi
Bernard El-Hagin
zaphod at neostrada.pl
Sun Jan 25 07:18:19 PST 2004
Kent Stewart <kstewart at owt.com> wrote:
>On Sunday 25 January 2004 01:43 am, marlon corleone wrote:
>> how do i get rid of this annoying character ^M using vi, in pico i
>> used the arguments '-w'
>> but what about in vi?
>
>
>starting on the 1st line type
>:.,$s/<ctrl>v<ctrl>m//
>
>The .,$ tells it to process from the current line to the last one.
If you're doing this for the whole file it's faster to use %
:%s/<ctrl>v<ctrl>m//
It's even faster to use
:se ff=unix
but that assumes we're talking about Vim, not Vi.
--
Cheers,
Bernard
More information about the freebsd-questions
mailing list