linux 执行.sh脚本时出现 $’\r’: 未找到命令

背景
  执行.sh脚本时出现$’\r’: 未找到命令,
原因
  是因为命令直接从windows 复制过来导致的
解决
  运行: yum install dos2unix


  dos2unix **.sh 进行转换
  再次执行即可

参考:https://blog.csdn.net/qq_39727001/article/details/102560102

猜你喜欢

转载自blog.csdn.net/csl12919/article/details/106849972