I am working on my shell scripts in wordpad in windows. Then, I upload it to my unix using psftp, but when I open those files with "vi" in Unix, there are all these "^M" characters in the file. Would anyone of you have a clue as to why?
If you still find them.open the file using vi. Stay in Escape mode and type the following :
:1,$s/<CTRL>+v <CTRL>+m//g
<ctrl>+v says that the next character is a special character. This will be substituted with nothing. i.o.w. removed
:1,$ just says from line number 1 until the end.