Your script file is a DOS text file. The extra carriage returns at the end of each line confuses bash (it sees do\r rather than do).
Convert it to a Unix text file using a tool such as dos2unix, or make sure that your editor saves it as a Unix text file.