Remove ^M characters from xhtml file

paul beard paulbeard at
Sun Nov 30 19:07:11 PST 2003

On Nov 30, 2003, at 6:53 PM, Melvyn Sopacua wrote:

> Another way: perl -pi.bak -e 's/\r$//' *.xhtml
> BTW: why is this even an issue that needs a solution? XHTML doesn't 
> care one
> way or the other, since all linear spacing is folded into one space.

It's distracting to look at all that stuff if you're editing in vi, for 
example. But for yet one more solution, you can search and replace ^M 
as Control V Control M in vi.

I also use perl -pi "s#\\r#\\n#g" <filename> all the time.
Paul Beard
paulbeard [at]

More information about the freebsd-questions mailing list