运行shell脚本的时候,报syntax error near unexpected token `$’{\r’’ error
用vim -b 查看,发现每一行多了 ~M
解决方法:
sed -i 's/\r//g' xxx.sh
这样脚本就可以运行了
运行shell脚本的时候,报syntax error near unexpected token `$’{\r’’ error
用vim -b 查看,发现每一行多了 ~M
解决方法:
sed -i 's/\r//g' xxx.sh
这样脚本就可以运行了