Yep, editing it with notepad is a “bad idea”.
Windows (DOS), MAC, and Unix/Linux indicate the end of a line in different ways, and you generally can’t “see” the difference. (if you are interested in the details of this, google has lots of information).
There are a several of ways you can “fix” this, and deal with the problem in the future:
1)Use an editor that lets you work with, and save, files on your computer with *nix style line endings. Then, make sure you ftp the file to your space ion ASCII mode. A great “free” editor for Windows that let’s you work with DOS,*NIX, and MAC line endings, is PSPad. To set the type of line ending for the file, pull-down the “Format” menu and look near the bottom.
2.) Edit the file from the *nix shell with a *nix editor, such as pico, nano, joe, vi, vim, etc. (there are resources explaining this in the DH wiki).
- From the shell, run the dos2unix program on the file in question.
Any of those options will result in you having a “good” *nix line-ending type file, and the script should then run fine.