linux执行sh报错:$’\r’: 未找到命令的解决

linux执行sh报错:$’\r’: 未找到命令的解决

背景

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

原因

  是因为命令直接从windows 复制过来导致的

解决

  yum install dos2unix

  dos2unix **.sh 进行转换

  再次执行即可

猜你喜欢

转载自blog.csdn.net/hqbootstrap1/article/details/88073842