Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Dec 2002 19:53:15 -0600 (CST)
From:      hawkeyd@visi.com (D J Hawkey Jr)
To:        wblock@wonkity.com, freebsd-questions@freebsd.org
Subject:   Re: tool/method to convert DOS line endings to UNIX line endings
Message-ID:  <200212040153.gB41rF154346@sheol.localdomain>
References:  <Pine.SGI.3.96.1021203155019.243744X-100000_y.dev.wamnet.com@ns.sol.net> <Pine.BSF.4.21.0212031550360.12062-100000_wonkity.com@ns.sol.net>

next in thread | previous in thread | raw e-mail | index | archive | help
[Posted and mailed]

In article <Pine.BSF.4.21.0212031550360.12062-100000_wonkity.com@ns.sol.net>,
	wblock@wonkity.com writes:
> On Tue, 3 Dec 2002, Lee J Carmichael wrote:
> 
>> If you are going from DOS to Unix you could use the following perl script:
> 
> [script snipped] 
> 
> It's a bit easier if you let Perl do the heavy lifting:
> 
> perl -pi -e 's/\r//g' file-to-convert

Even easier (and "lighter") if you ditch the perl:
   sed -e 's/\r//g' input >output

I like the tr(1) conversion too, but I always seem to think in terms of
sed(1) and awk(1).

> -Warren Block * Rapid City, South Dakota USA

:-)
Dave

-- 

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"


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?200212040153.gB41rF154346>