I needed to convert an entire directory of files from dos to unix format, so I have used the following combination, inspired by
madluther's post.
Code:
find | sed -e "s/\(.*\)/tr -d \'\\\r\' < \1 > __\1/g" | sed -e "s/__\.\//\.\/__/" | /bin/sh
find -iname "__*" | sed -e "s/.\/__\(.*\)$/\/bin\/mv .\/__\1 .\/\1/g" | /bin/sh
Possible issues with this:
-it gives warnings about directories
-it will not work with any files in sub-directories
-probably any files starting with '__' can be badly affected