I have a php script that is run as a cron job. I get this error when I try to run it from the command line, and this is due to line endings being saved as Windows (CRLF) instead of plain old Unix (LF). A few methods to fix this, however, they weren't quite working - reg ex searches "completed" but didn't change them.
2) :set fileformat=unix
Magic. This forces the file to be saved as Unix, and changes all the line endings to match. :x and test...
No error, so cron job will work fine now!