如果是在windows下编辑的脚本,到了linux下运行时会报出这样的错误
/bin/bash^M:bad interpreter: No such file or directory
这时因为编码的问题,需要进行编码转换。使用sudo vim xxx打开文件,:set ff可以看到当前的格式,应该是dos,使用set ff=unix,更改其格式,然后保存退出,就能正常的运行程序了

相关文章:

  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2021-10-03
  • 2021-12-18
  • 2022-03-05
  • 2022-12-23
猜你喜欢
  • 2021-07-21
  • 2021-07-25
  • 2021-10-16
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案