问题描述:sh文件中,在win环境下,用WinSCP编辑,出现如下错误:
-bash: ./start.sh: /bin/sh^M: bad interpreter: No such file or directory
解决方案:这是win的编码引起的,可通过如下解决。
1.查看该文件:vim start.sh
2.查看该错误文件的格式(一般报错的文件格式是DOS):
:set ff
3.修改该文件格式为UNIX:
:set ff=unix
4.再保存。
:wq!
---------------------
作者:lizhengnanhua
来源:CSDN
原文:https://blog.csdn.net/lizhengnanhua/article/details/51724396
版权声明:本文为博主原创文章,转载请附上博文链接!
相关文章
- /bin/bash^M: bad interpreter: No such file or directory 解决办法
- shell脚本异常“bash: ./rebuild.sh: /bin/sh^M: bad interpreter: No such file or directory”
- Linux下执行.sh命令出现-bash: ./bin/start.sh: /bin/bash^M: bad interpreter: No such file or directory
- -bash: ./start.sh: /bin/sh^M: bad interpreter: No such file or directory 错误解决方案
- -bash: ./start.sh: /bin/sh^M: bad interpreter: No such file or directory 错误解决方案
- bash:./configure /bin/sh^M: bad interpreter: No such file or directory
- shell脚本报错:-bash: xxx: /bin/sh^M: bad interpreter: No such file or directory
- 安装JDK出现错误:-bash: /usr/java/jdk1.7.0_71/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory解决办法
- 执行.sh文件 报错:-bash: xxx: /bin/sh^M: bad interpreter: No such file or directory
- sh脚本异常:/bin/sh^M:bad interpreter: No such file or directory