From owner-freebsd-questions Thu Jun 7 22:22:48 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail5.carolina.rr.com (fe5.southeast.rr.com [24.93.67.52]) by hub.freebsd.org (Postfix) with ESMTP id 0731237B405 for ; Thu, 7 Jun 2001 22:22:45 -0700 (PDT) (envelope-from jconner@enterit.com) Received: from CONCON.enterit.com ([24.88.181.33]) by mail5.carolina.rr.com with Microsoft SMTPSVC(5.5.1877.687.68); Fri, 8 Jun 2001 01:22:43 -0400 Message-Id: <5.1.0.14.0.20010608013945.02504e90@mail.enterit.com> X-Sender: jconner@enterit.com@mail.enterit.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 08 Jun 2001 01:43:43 -0400 To: Andrew Hesford From: Jim Conner Subject: Re: __ how to eliminate "^M" in ASCII files. Cc: bsdnewbie bsdnewbie , freebsd-questions@freebsd.org In-Reply-To: <20010607215708.A1428@core.usrlib.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed 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 :) Thats what this was: $(locate dos2unix | head -1) file1 > file2 or $ sed 's/\015//g' file1 > file2 But I would like to change it a lil: $ [ -z $(locate dos2unix | head -1) ] && sed 's/\015//g' file1 > file2 || dos2unix file1 > file2 This should be able to tell whether or not dos2unix is even there. Lets just hope there isn't a man page only installed without the binary. :) - Jim At 09:57 PM 6/7/2001 -0500, Andrew Hesford wrote: >On Fri, Jun 08, 2001 at 10:17:51AM +0800, bsdnewbie bsdnewbie wrote: > > Is there any tool can eliminate "^M" in text files? > > Thanks in advance. > > > > best regards, > > steven > >Everybody comes up with these home-brewed solutions. > >Has everyone forgotten about the old "unix2dos" and "dos2unix" >utilities? It's in the ports, /usr/ports/converters/unix2dos. > >-- >Andrew Hesford >ajh3@usrlib.org > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message - Jim - NOTJames - jconner@enterit.com - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - | Today's errors, in contrast: | - | Windows - "Invalid page fault in module kernel32.dll at 0032:A16F2935" | - | UNIX - "segmentation fault - core dumped" | - | Humans - "OOPS, I've fallen and I can't get up" | - -------------------------------------------------------------------------- - (To view this properly use a non-proportional font in your MUA) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message