原文:运行shell脚本提示syntax error near unexpected token `$'do\r''

运行shell脚本提示 test.sh: line : syntax error near unexpected token do r est.sh: line : do 使用sublime text将文件格式转换为UNIX格式 ...

2020-05-21 11:25 0 844 推荐指数:

查看详情

执行shell脚本报错syntax error near unexpected token `$'\r''解决方法

今天在进行性能测试时,正好需要一个老脚本,直接拿过来修改一下就可以使用,但是运行时直接报错了syntax error near unexpected token `$'\r' 内心一万个WTF,为啥不行呢 第一步 vim -b XXX.sh 我ca,果然如此,在复制进来后,怎么每行后面 ...

Tue Jul 28 00:00:00 CST 2020 0 1250
shell脚本syntax error near unexpected token `done'

1、修改文件类型 执行: vi finddir.sh 输入 :set ff 如果fileformat=dos ,修改为unix: :set ff=unix 执行保存命令: :wq 2、删除隐藏字符 用命令vi -b 打开你的SHELL脚本文件,你会。发现每行脚本最后多了个^M ...

Sun Jan 26 19:49:00 CST 2020 0 2171
syntax error near unexpected token `$'{\r''

error:syntax error near unexpected token `$'{\r'' 不知道大家有没有在windows上面编写shell脚本,然后部署到linux上运行的经历,如果你做过类似的事情,那你可能遇到过这个问题:syntax error near unexpected ...

Sun Feb 28 21:17:00 CST 2021 0 355
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM