sh脚本异常:bad interpreter: No such file or directory

命令查看文件格式
:set ff 或 :set fileformat

可以看到如下信息
fileformat=dos 或 fileformat=unix

利用如下命令修改文件格式
:set ff=unix 或 :set fileformat=unix

:wq (存盘退出)

最后再执行文件
#sh>./filename
 
////////////////////////////////////////////////////
 
解决了:configure是在window下写的,所以在每行后面会加个ctrl+m就是^M,所以后面的,sh就变成sh^M当然是没有这个命令的,所以脚本就不能运行了,把^M去掉就应该没问题了
     cat ./configure | tr -d '\r' > temp
     mv temp configure
     sudo chmod +x configure
     ./configure
     make

相关文章:

  • 2021-11-18
  • 2021-11-15
  • 2021-07-10
  • 2021-12-05
  • 2021-06-19
  • 2022-02-09
猜你喜欢
  • 2021-05-06
  • 2021-11-09
  • 2021-09-02
  • 2021-11-14
  • 2021-08-14
  • 2021-12-13
相关资源
相似解决方案