Is there a way to find whether a file contains ^M character in it?. It's quite obvious to vi, but can this be accomplished using an automated way to find recursively in a directory.
probably i guess the best way would be to
1) Read the file and check if the end of line is ^M
2) If so, then echo saying the file has ^M character
3) Else not
(the control-m (^M) in the grep is acquired by pressing control-v then control-m - i.e. don't cut and paste the above code, because it won't give you the desired result!)
so what are you going to do after finding there are ^M characters? Ultimately, do you want to remove them? if yes, use the find command together with dos2unix.