当前位置: 代码迷 >> 综合 >> -bash: ./test0.sh: /bin/bash^M: bad interpreter: 没有那个文件或目录
  详细解决方案

-bash: ./test0.sh: /bin/bash^M: bad interpreter: 没有那个文件或目录

热度:52   发布时间:2024-01-26 16:13:19.0

[yan_bingqing@FPGAT630 shell_test]$ chmod +x ./test0.sh
[yan_bingqing@FPGAT630 shell_test]$ ./test0.sh
-bash: ./test0.sh: /bin/bash^M: bad interpreter: 没有那个文件或目录

原因:window下编译的格式需要转成unix格式的;

1.查看fomat格式

 :set ff?

2.修改格式

 :set ff=unix

3.保存

 

重新运行./test0.sh  OK了

  相关解决方案