#!/usr/local/bin/perl -- # -*-Perl-*- ###################################################################### ## Filename: dos2unix.pl ## Author: Eddie Baron ## Created at: Mon Apr 18 11:50:17 2005 ## Modified at: Mon Apr 18 11:51:28 2005 ## Modified by: Eddie Baron ## Version: ## Description: ###################################################################### # Take a DOS file and chop off the \M # # # if($#ARGV < 0 ) { die("Usage:\n\t dos2unix.pl \n"); } $ofile=$ARGV[0]; $file=$ARGV[0].".tmp"; open(FNEW,">$file") || die("Can't open file $file\n"); open(FOLD,"$ofile") || die("Can't open file $ofile\n"); while() { s/\r\n/\n/; print FNEW $_; } close(FOLD); close(FNEW); unlink($ofile) || die("Can't remove $ofile\n"); system ("mv $file $ofile");