Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Apr 2002 20:18:05 +0200
From:      "Roger 'Rocky' Vetterberg" <listsub@rambo.simx.org>
To:        Ian Barnes <ianbarn@mweb.co.za>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: removing underscore M
Message-ID:  <3CBB195D.1080208@rambo.simx.org>
References:  <001701c1e44e$3134a400$8400000a@comrite.co.za>

next in thread | previous in thread | raw e-mail | index | archive | help
Ian Barnes wrote:

> Hi,
>
> I was wondering if there is a script that can remove that annoying M 
> (with underscore) from my files ?
>
> Thanx
>
> Ian
>
A quick and easy way is
perl -i.bak -npe 's/\r\n/\n/g' <file>

Where <file> is the name of the file poluted with those annoying ^M's. 
The original file will be saved as file.bak, just in case, allthough I 
have never had any problems and I frequently use this command.

--
R


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?3CBB195D.1080208>