Converts text files from M$ (CR/LF) to Linux (LF) , and vice-versa

Solution 1:
Much more simple, edit file with vim and do: :set ff=unix

Solution 2:
Well if you need convert some files that was develop with M$ and remove ^M in Linux. You may use tofodos and you may run this simple script to convert files from some directories:
find . -type f -exec fromdos {} \;

But other problem, some M$ files don't have an eof (end of line) in last line of the file, just have an eof (end of file)
On vim we see [noeof] when edit the M$ file. This information have several years, I don't know if they have fixed it meantime.