Rev Author Line No. Line
250 kaklik 1 #!/bin/sh
2 #
3 # $Id: remove_control_m.sh,v 2.0 2003/11/18 15:20:45 nijel Exp $
4 #
5 # Script to remove ^M from files for DOS <-> UNIX conversions
6 #
7  
8 if [ $# != 1 ]
9 then
10 echo "Usage: remove_control_m.sh <extension of files>"
11 echo ""
12 echo "Example: remove_control_m.sh php3"
13 exit
14 fi
15  
16 for i in `find . -name "*.$1"`
17 do
18 echo $i
19 tr -d '\015' < $i > ${i}.new
20 rm $i
21 mv ${i}.new $i
22 done;
23