When I am editing source files using vim and other editors sometimes at the end of the line I get these ^M characters at the end of each line. I think that it has something
I tend to run afflicted files through fromdos before reopening them. fromdos is part of the tofrodos package.
fromdos