http://t.csdn.cn/yPQOp
在执行脚本时,出现了: invalid option
错误
最后在stackoveflow上找到了答案
You script probably has characters in it that you cannot see. Perhaps it was copy/pasted using the wrong character set translation or is in DOS format. In the case of the latter you can use the tofrodos or dos2unix package to correct.
In either case you could pull it up in ‘vi’ or another application which will usually show weird characters like ^@ or ^M. You could try cat -v filename which might help see these oddities. Push comes to shove try hexdump (or hd, or od).
原来是因为使用window 复制黏贴该文件时,文件的格式发生了变化。
解决方案:在ubuntu上使用dos2unix
命令去除格式即可