From owner-freebsd-questions Thu May 9 07:02:50 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id HAA06955 for questions-outgoing; Thu, 9 May 1996 07:02:50 -0700 (PDT) Received: from gw0.telebase.com (root@gw0.telebase.com [192.132.57.100]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id HAA06938 for ; Thu, 9 May 1996 07:02:42 -0700 (PDT) Received: from wormhole.telebase.com by gw0.telebase.com id KAA25991; Thu, 9 May 1996 10:02:34 -0400 (EDT) Received: from odo.telebase.com (root@odo.telebase.com [172.16.2.217]) by wormhole.telebase.com (8.7.1/8.6.9.1) with ESMTP id KAA03377; Thu, 9 May 1996 10:02:33 -0400 (EDT) Received: (from bmc@localhost) by odo.telebase.com (8.7.5/8.6.9.1) id KAA01782; Thu, 9 May 1996 10:02:33 -0400 (EDT) Date: Thu, 9 May 1996 10:02:33 -0400 (EDT) Message-Id: <199605091402.KAA01782@telebase.com.> From: Brian Clapper To: mcs@vpm.com (Mark Stout) Cc: questions@freebsd.org Subject: Re: dos2unix for FSB? In-Reply-To: <61505805@toto.iv> Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Mark Stout wrote: > > Is there a port for dos2unix/unix2dos for FSB? I can't locate anything on > it, so I'm wondering if others know. I use two small perl scripts (enclosed); they work fine and don't require porting. dos2unix: #!/usr/bin/perl -pi # # Convert DOS text file to Unix file format. Conversion is done in-place. # # Usage: dos2unix dosfile ... print STDERR "Converting \"$ARGV\" ...\n" if (eof || ($. == 0)); s/\015$//; # strip ^M from end of line. s/\032$//; # strip ^Z if we see it (which'll be at EOF). unix2dos: #!/usr/bin/perl -pi # # Convert Unix text file to DOS file format. Conversion is done in-place. # # Usage: unix2dos unixfile ... print STDERR "Converting \"$ARGV\" ...\n" if (eof || ($. == 0)); s/$/\015/; # tack on ^M s/\n/\n\032/ if (eof); # DOS ^Z at end of file. ---- Brian Clapper .............................................. bmc@telebase.com http://www.netaxs.com/~bmc/ ............. PGP public key available on request Half of one, six dozen of the other.