Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Aug 2000 10:58:24 -0700 (PDT)
From:      Lew Payne <lew@lppi.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: vi
Message-ID:  <200008011758.KAA10340@relay.lppi.com>
In-Reply-To: <F5QinOkrx8BiC6HbSzx00000e97@hotmail.com>
References:  <F5QinOkrx8BiC6HbSzx00000e97@hotmail.com>

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

On Tue, 01 Aug 2000, Adam Hefetz wrote:
>
> Every time I open a text file on vi,
> I get '^M' in the end of each line.
> How can I get these signs of other then
> deleting them manually?

perl -pi -e "s:^V^M::g" <filenames>
where ^V and ^M are actually the control chars, not the meta-chars!
or, you can do any of these (non-meta char rule still applies);
cat <filename1> | tr -d "^V^M" > <newfile>
sed -e "s/^V^M//" <filename> > <output filename>
-- and in vi you can:
1) hit the ESC key
2) :%s/^V^M//

---
Lew Payne Publishing, Inc.             Dunn & Bradstreet listed
994 San Antonio Road                     DUNS # 055037852
Palo Alto, CA  94303



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?200008011758.KAA10340>