Removes the ^M character in Unix/Linux

This script removes the ^M character from the file. Mainly for those who use windows editor to edit Unix/Linux text files. I would definitely recommend VI or emacs if you are messing with Unix/Linux text files. Create a shell script file and copy paste the code below.
#Script to remove the ugly DOS ^M characters
for readfiles in $@
tr -d 'r' < $readfiles > $sometempfile.tmp
mv $sometempfile.tmp $readfiles