解决方法:
(1)使用linux命令dos2unix filename,直接把文件转换为unix格式
(2)使用sed命令sed -i "s/\r//" filename 或者 sed -i "s/^M//" filename直接替换结尾符为unix格式
(3)vi filename打开文件,执行 : set ff=unix 设置文件为unix,然后执行:wq,保存成unix格式。
相关文章
- 01-29xmanager运行报错:bash: /usr/bin/xterm: No such file or directory
- 01-29[已解决]chroot: failed to run command ‘/bin/bash’: No such file or directory
- 01-29/bin/bash^M: bad interpreter: No such file or directory
- 01-29/bin/bash^M: bad interpreter: No such file or directory”
- 01-29/bin/sh^M:bad interpreter: No such file or directory问题
- 01-29/bin/bash^M: bad interpreter: No such file or directory问题
- 01-29bash: ./1.sh: /bin/bash^M: bad interpreter: 没有那个文件或目录
- 01-29line 1: ?#!/bin/bash: No such file or directory
- 01-29执行shell脚本 报-bash: ./run.sh: /bin/bash^M: bad interpreter: No such file or directory
- 01-29stat /bin/bash: no such file or directory“: unknown.