#!/usr/local/bin/perl -- # -*-Perl-*- ###################################################################### ## Filename: mac2unix ## Author: Eddie Baron ## Created at: Mon Apr 18 11:50:17 2005 ## Modified at: Fri Jan 13 17:24:19 2006 ## Modified by: Eddie Baron ## Version: ## Description: ###################################################################### # Take a MAC file and chop off the \M to \n # # # if($#ARGV < 0 ) { die("Usage:\n\t mac2unix \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/g; print FNEW $_; } close(FOLD); close(FNEW); unlink($ofile) || die("Can't remove $ofile\n"); system ("mv $file $ofile");