美文网首页
[bug]-bash: ./zk.sh: /bin/bash^M

[bug]-bash: ./zk.sh: /bin/bash^M

作者: bigdata张凯翔 | 来源:发表于2020-06-25 15:33 被阅读0次

执行shell脚本报这个错
运行脚本时出现了这样一个错误,打开之后并没有找到所谓的^M,查了之后才知道原来是文件格式的问题,也就是linux和windows之间的不完全兼容。。。
具体细节不管,如果验证:

vim test.sh
:set ff?
如果出现fileforma=dos那么就基本可以确定是这个问题了。
:set fileformat=unix
:wq

参考:
/bin/bash^M: bad interpreter: 没有那个文件或目录
http://blog.sina.com.cn/s/blog_5f7d8ca30101bv5m.html

相关文章

网友评论

      本文标题:[bug]-bash: ./zk.sh: /bin/bash^M

      本文链接:https://www.haomeiwen.com/subject/vvmsfktx.html