Date: Wed, 26 Dec 2001 04:06:41 +0100 From: Roman Neuhauser <neuhauser@mobil.cz> To: FBSD Questions <questions@FreeBSD.ORG> Subject: Re: Dos -> Unix end-of-line conversion Message-ID: <20011226040641.I850@roman.mobil.cz> In-Reply-To: <LPBBIGIAAKKEOEJOLEGOCEGDCKAA.barbish@a1poweruser.com> References: <20011226113216.A24782@grimoire.chen.org.nz> <LPBBIGIAAKKEOEJOLEGOCEGDCKAA.barbish@a1poweruser.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> From: "Joe & Fhe Barbish" <barbish@a1poweruser.com>
> To: "Jonathan Chen" <jonc@chen.org.nz>
> Cc: "FBSD Questions" <questions@FreeBSD.ORG>
> Subject: RE: Dos -> Unix end-of-line conversion
> Date: Tue, 25 Dec 2001 20:51:01 -0500
>
> How can I get this command to roll through a directory tree processing all
> the files to feed this $ tr -d '\r' < oldfile > newfile command converting
> dos2unix or unix2dos? There is a dos2unix / unix2dos port but it only does
> one file at a time.
By plugging it into find(1):
find /somewhere -iregex '.*\.txt' -exec tr -d '\r' < {} > {}.new \;
<usual disclaimer about untested code>
> -----Original Message-----
> From: owner-freebsd-questions@FreeBSD.ORG
> [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Jonathan Chen
> Sent: Tuesday, December 25, 2001 5:32 PM
> To: Michal Pasternak
> Cc: freebsd-questions@FreeBSD.ORG
> Subject: Re: Dos -> Unix end-of-line conversion
>
> On Tue, Dec 25, 2001 at 11:24:41PM +0100, Michal Pasternak wrote:
> > Hello,
> >
> > are there any programs (in baseinstall) which allow that (except perl)?
>
> $ tr -d '\r' < oldfile > newfile
>
> is one quick and dirty way to do it...
> --
> Jonathan Chen <jonc@chen.org.nz>
> -----------------------------------------------------------------------
> "I love deadlines. I like the whooshing sound they make as they fly by"
> - Douglas Adams
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
--
FreeBSD 4.4-STABLE
4:04AM up 4 days, 34 mins, 9 users, load averages: 0.04, 0.02, 0.00
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?20011226040641.I850>
