From owner-freebsd-questions Wed Dec 4 8:32:21 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 F09BE37B401 for ; Wed, 4 Dec 2002 08:32:19 -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 7231843EAF for ; Wed, 4 Dec 2002 08:32:19 -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 98E1B4C63; Wed, 4 Dec 2002 10:32:18 -0600 (CST) Received: (from hawkeyd@localhost) by sheol.localdomain (8.11.6/8.11.6) id gB4GWH812062; Wed, 4 Dec 2002 10:32:17 -0600 (CST) (envelope-from hawkeyd) Date: Wed, 4 Dec 2002 10:32:17 -0600 From: D J Hawkey Jr To: Jerry McAllister Cc: Warren Block , freebsd-questions@FreeBSD.ORG Subject: Re: tool/method to convert DOS line endings to UNIX line endings Message-ID: <20021204103217.A12019@sheol.localdomain> Reply-To: hawkeyd@visi.com References: <20021204080104.A56240@sheol.localdomain> <200212041520.gB4FKgD20705@clunix.cl.msu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200212041520.gB4FKgD20705@clunix.cl.msu.edu>; from jerrymc@clunix.cl.msu.edu on Wed, Dec 04, 2002 at 10:20:41AM -0500 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 On Dec 04, at 10:20 AM, Jerry McAllister wrote: > > > This'll work though: > > sed -e 's/[[:cntrl:]]$//g' > > > > > > I like the tr(1) conversion too, but I always seem to think in terms of > > > > sed(1) and awk(1). > > > > And if that sed(1) solution is still "too loose", the tr(1) solution reduces > > "[[:cntrl:]]" to just the CR character. > > Just to be clear on this issue; you want to be left with the LF characters > and get rid of the CR characters not the other way around. I am not a sed > person, but your statement is backwards even if your sed works. No, I meant what I wrote, though you gave me pause to double-check. The "[[:cntrl:]]" and reference to the CR character ("\r" = carriage-return) are what's being stripped. I pro'lly should have finished the sentence with "... for stripping." or somesuch. > ////jerry Dave -- ______________________ ______________________ \__________________ \ D. J. HAWKEY JR. / __________________/ \________________/\ hawkeyd@visi.com /\________________/ http://www.visi.com/~hawkeyd/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message