FTP Shell Scripts from Windows to Unix: files have exotic characters

Hey guys,

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?

Help would be appreciated.

Thanks,
Laud

ftp your files in ASCII mode [NOT binary].

I am using PSFTP since I can only do SSH FTP. What utility do you guys use that would be more user friendly and has ability to do SSH.

Thanks vgersh99: you must be a real guru at this

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.

This is mentioned in the forum by many others.

You can also try using dos2unix command