Skip site navigation (1)Skip section navigation (2)
Date:      06 Jun 2001 09:33:38 -0500
From:      Don Croyle <croyle@gelemna.org>
To:        James Housley <jim@thehousleys.net>
Cc:        Damien Tougas <damien@carroll.com>, Laura Gioia <laura@satori.inet.it>, questions@FreeBSD.ORG, G D McKee <freebsd@gdmckee.com>
Subject:   Re: ^M
Message-ID:  <86vgm9ekzh.fsf@emerson.gelemna.org>
In-Reply-To: James Housley's message of "Wed, 06 Jun 2001 10:16:02 -0400"
References:  <96950000.991836351@01.dhcp.hck.carroll.com> <015501c0ee92$71ca67a0$0a00a8c0@gdmckee.local> <3B1E3B22.4E56D186@thehousleys.net>

next in thread | previous in thread | raw e-mail | index | archive | help
James Housley <jim@thehousleys.net> writes:

> G D McKee wrote:
> > 
> > Hi
> > 
> > On think topic does anyone know who to get the ^M's back again so as M$
> > notepad can read the files correctly.
> > 
> 
> Wordpad will do fine.  
> 
> In vi (^-ctrl)
> 
> :%s/$/^V^M/

If this is something you need to do frequently,

perl -pi -e 's/\r//' filename (to remove the ^Ms)
perl -pi -e 's/\n/\r\n/' filename (to put them back)

have the advantage of being something that can be turned into an alias
or shell script.
-- 
I've always wanted to be a dilettante, but I've never quite been ready
to make the commitment.

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?86vgm9ekzh.fsf>