Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Feb 1998 22:14:30 -0500 (EST)
From:      "Joe \"Marcus\" Clarke" <marcus@miami.edu>
To:        Bryce Newall <data@dreamhaven.org>
Cc:        FreeBSD Questions List <freebsd-questions@FreeBSD.ORG>
Subject:   Re: unix2dos/dos2unix/fromdos/todos
Message-ID:  <Pine.OSF.3.96.980224221313.22508A-100000@jaguar.ir.miami.edu>
In-Reply-To: <Pine.NEB.3.96.980224180105.17892C-100000@ds9.dreamhaven.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I have two perl scripts that convert UNIX text to DOS text and vice
versa.  If that's what you want, here are the sources:

dos2unix:

#!/usr/local/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/local/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.

On Tue, 24 Feb 1998, Bryce Newall wrote:

> Greetings,
> 
> I am looking for (preferably) source from which to compile the above
> programs under FreeBSD, or possibly a site from where I might be able to
> obtain binary versions for FreeBSD 2.2.5-STABLE.  I've searched all over
> the place and have turned up nothing.  Any ideas where I might find this?
> 
> Thanks in advance,
> Bryce
> 
> **********************************************************************
> *       Bryce Newall       *       Email: data@dreamhaven.org        *
> *               WWW: http://home.dreamhaven.org/~data                *
> *               "Stop smirking, Number 1."  -- J.L. Picard           *
> *          "I'm a doctor, not a doorstop!"  -- EMH Program, ST:FC    *
> **********************************************************************
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.3.96.980224221313.22508A-100000>