#!/bin/sh # john meister September 20, 2000 # PURPOSE: removes PC type carriage returns (^M) from ascii files # ARGS: $1 is filename passed with script # TEMPFILE=/tmp/temp_file$$ tr -d '\015' < $1 > $TEMPFILE # NOTE - THIS WILL DAMAGE JPG and binary files - only use on plain text files! cmp $1 $TEMPFILE if [ $? -eq 0 ] then echo " " echo " no evil micr0s0ft influence detected," echo " file not edited... carry on..." echo " " else echo " " echo " purging file of evil micr0s0ft influence" echo " " echo " one moment please..." echo " " echo " file edited. ########" echo " don't you feel better now? " echo " ########" echo " " cp $TEMPFILE $1 fi rm -f $TEMPFILE