linux shell脚本无法执行,报错syntax error near unexpected token `$‘\r‘‘解决方法
运行shell脚本时出现:syntax error near unexpected token `$’\r“的错误,一般是格式的问题,比如直接从txt文档拷贝过来的内容;
例如test.sh脚本
解决方法:sed -i ‘s/\r//g’ test.sh
然后再执行 sh test.sh
原创
2020-07-01 14:23:31 ·
651 阅读 ·
0 评论