linux执行脚本出现-bash: ./a.sh: /bin/bash^M 报错,可能是因为编辑工具的原因导致文件格式不对
在linux上使用vim命令进入文件vim a.sh
查看文件格式:set ff
若果提示是fileformat=dos 则使用:set fileformat=unix
将文件格式转成unix
linux执行脚本出现-bash: ./a.sh: /bin/bash^M 报错,可能是因为编辑工具的原因导致文件格式不对
在linux上使用vim命令进入文件vim a.sh
查看文件格式:set ff
若果提示是fileformat=dos 则使用:set fileformat=unix
将文件格式转成unix