From owner-freebsd-stable Mon May 3 12:51:33 1999 Delivered-To: freebsd-stable@freebsd.org Received: from fed-ef1.frb.gov (fed.frb.gov [132.200.32.32]) by hub.freebsd.org (Postfix) with ESMTP id 0CC8C1547E for ; Mon, 3 May 1999 12:51:30 -0700 (PDT) (envelope-from seth@freebie.dp.ny.frb.org) Received: by fed-ef1.frb.gov; id PAA15081; Mon, 3 May 1999 15:51:17 -0400 (EDT) Received: from m1pmdf.frb.gov(192.168.3.38) by fed.frb.gov via smap (V4.2) id xmad14541; Mon, 3 May 99 15:50:59 -0400 Date: Mon, 03 May 1999 15:50:29 -0400 (EDT) From: Seth Subject: Re: Dos2unix In-reply-to: To: Vince Vielhaber Cc: freebsd-stable@FreeBSD.ORG Message-id: MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG While this works in the majority of cases (I use the same command on occasion), it has the nasty side effect of stripping ALL ^M's, not just those occuring at EOL, and won't do anything about the ^Z's you get at the end of (some) DOS files. Sed can be used for this, as can perl (as people have pointed out). Not to start a war here, but perl just seems to me to be overkill for something as simple as this. SB On Mon, 3 May 1999, Vince Vielhaber wrote: > > This is all I use in a shell script to convert to unix. > > tr -d '^M' < $1 > > But change the ^M to an actual ASCII 13. I call it 2ux and to > use it: > > 2ux INFILE > OUTFILE > > I've never bothered converting them back, if needed I just load it into > an editor on the dos machine and save it, but you can probably use tr or > sed to do that if you really needed to. > > Vince. > -- > ========================================================================== > Vince Vielhaber -- KA8CSH email: vev@michvhf.com flame-mail: /dev/null > # include TEAM-OS2 > Online Campground Directory http://www.camping-usa.com > Online Giftshop Superstore http://www.cloudninegifts.com > ========================================================================== > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-stable" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message