sh脚本有\r字符的解决方法 (通常发生在把windows下的代码拷贝到linux下运行) 替换 sudo sed -i 's/\r//' test1215.sh or sudo dos2unix test1215.sh or vim脚本文件,输入 :set fileformat=unix