Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 May 2001 14:17:31 -0400
From:      "Matthew Emmerton" <matt@gsicomp.on.ca>
To:        "Christopher Leigh" <clcont@lubbockcomputer.com>, <freebsd-questions@FreeBSD.ORG>
Subject:   Re: how to remove ^M from files with tr?
Message-ID:  <001e01c0d658$d15700e0$1200a8c0@gsicomp.on.ca>
References:  <20010506181546.11982.qmail@lubbockcomputer.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> hi.
>
> i'd like to remove ^M from files with tr, but i don't know how to do it.
>
> i *THINK*, i'm not sure if my memory serves me right, but...
>
> tr -d \\015\\012 < file.txt > file.txt.unix
>
> worked in linux, but it won't work in freebsd.

Won't that tr line remove the \n AND the \r?  I think you should just use
tr -d \\0015 < file.txt > file.txt.unix.

Alternatively, check out the dos2unix port.

--
Matt Emmerton


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?001e01c0d658$d15700e0$1200a8c0>