If you have created the script file in windows you would get this error while running from Linux . Try creating the script file in Linux vi editor, paste the script and save . Alternatively you could run the following command for your script file to remove trailing \r character sed -i 's/\r$//' filename
... View more