执行shell脚本如果报如下错误:
syntax error near unexpected token `$' ''
syntax error: unexpected end of file
$' ': command not found
可能原因是写代码是编辑环境是window,或者Linux下的非Linux编码,
可以执行:dos2unix filename 来解决。