From owner-freebsd-questions Tue Dec 3 17:53:23 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D7DE037B401 for ; Tue, 3 Dec 2002 17:53:21 -0800 (PST) Received: from bodb.mc.mpls.visi.com (bodb.mc.mpls.visi.com [208.42.156.104]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FA6643E9C for ; Tue, 3 Dec 2002 17:53:21 -0800 (PST) (envelope-from hawkeyd@visi.com) Received: from sheol.localdomain (hawkeyd-fw.dsl.visi.com [208.42.101.193]) by bodb.mc.mpls.visi.com (Postfix) with ESMTP id AF95D4A21; Tue, 3 Dec 2002 19:53:20 -0600 (CST) Received: (from hawkeyd@localhost) by sheol.localdomain (8.11.6/8.11.6) id gB41rF154346; Tue, 3 Dec 2002 19:53:15 -0600 (CST) (envelope-from hawkeyd) Date: Tue, 3 Dec 2002 19:53:15 -0600 (CST) Message-Id: <200212040153.gB41rF154346@sheol.localdomain> Mime-Version: 1.0 X-Newsreader: knews 1.0c.0 Reply-To: hawkeyd@visi.com Organization: if (!FIFO) if (!LIFO) break; References: From: hawkeyd@visi.com (D J Hawkey Jr) Subject: Re: tool/method to convert DOS line endings to UNIX line endings Newsgroups: sol.lists.freebsd.questions To: wblock@wonkity.com, freebsd-questions@freebsd.org Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG [Posted and mailed] In article , 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