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

[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了

发布了3 篇原创文章 · 获赞 0 · 访问量 63

猜你喜欢

转载自blog.csdn.net/weixin_43146112/article/details/104051482