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