shell脚本报错:-bash: xxx: /bin/sh^M: bad interpreter: No such file or directory
shell脚本仅支持unix文件格式,windows下.sh文件文dos格式。
vim test.sh
:set ff=unix
:set ff #查看当前格式
或通过命令dos2unix test.sh
转换格式
shell脚本仅支持unix文件格式,windows下.sh文件文dos格式。
vim test.sh
:set ff=unix
:set ff #查看当前格式
或通过命令dos2unix test.sh
转换格式
也可通过`sed -i s/Ctrl + v + m//g 文件名`解决