本文转载自:http://liujinpan75.iteye.com/blog/644894
cygwin shell syntax error near unexpected token
This is a common error and the reason is your are using Windows to create the file. Thus the line break is /r/n rather than /n.
All you need to do is change the format using a system command:
dos2unix filename_here
简单的说,就是用 dos2unix 命令进行转换,将windows格式的文本转成unix格式的文本。
dos2unix命令格式:
dos2unix <文件名>