Ubuntu18 Shell脚本出现 $'\r': command not found

出现这种问题一般就是脚本是在win平台下的,所以是属于dos指令,需要安装 dos2unix ,来转换成unix系统下的脚本:

sudo apt-get install dos2unix

使用方法,假设是对 test.sh 文件进行转换:

dos2unix test.sh

之后再用bash就一切正常了:

Ubuntu18 Shell脚本出现 $'\r': command not found

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2021-11-22
  • 2021-12-02
  • 2022-12-23
  • 2021-06-17
猜你喜欢
  • 2022-12-23
  • 2022-01-24
  • 2021-09-10
  • 2021-08-27
  • 2022-12-23
相关资源
相似解决方案