If you are working or playing around with files on different O.S., and you are just copying/moving files from one O.S. based system to other. Unknowingly you are inviting non-printable character to come with! This specially happens when you open any file in Linux using any editor (vim in my case), which you got from windows based machines. You will see ^M at the end of each line (It is usually treated as carriage return/linefeed in Linux environment which we got from its step brother Windows :p ).
How to remove ^M and other non-printable characters from the file in Linux
If you are working or playing around with files on different O.S., and you are just copying/moving files from one O.S. based system to other. Unknowingly you are inviting non-printable character to come with! This specially happens when you open any file in Linux using any editor (vim in my case), which you got from windows based machines. You will see ^M at the end of each line (It is usually treated as carriage return/linefeed in Linux environment which we got from its step brother Windows :p ).