(亲测有效)解决shell脚本运行报错

运行shell时报错:

bash:./test.sh:/bin/sh^M:bad interpreter:No such file or directory

vim test.sh,Esc+:进入编辑模式,set ff回车,看到左下角fileformat=dos,说明格式不对,set ff=unix,回车,wq保存退出执行就不报上述的错了。

猜你喜欢

转载自blog.csdn.net/qq_20490175/article/details/126644345
今日推荐