CentOS执行shell脚本出现$' ':command not found

主要原因:windows下编辑的脚本与linux编辑的脚本,在回车换行的符号有所不同造成的
解决方案:
Centos下有个命令dos2unix
你只要输入dos2unix *.sh就可以完成转换工作了
如果命令不存在的话就使用下命令安装
yum install dos2unix -y
原文地址:https://www.cnblogs.com/khtt/p/15338619.html