./startBatch.sh line 2 :$'\r': command not found

原因是 windows 下的换行符是 \r\n,而 linux 下的换行符是 \n
解决方案:首先 安装 dos2unix

yum install dos2unix -y

第一步 :chmod +x startBatch.sh
第二步 :你只要输入dos2unix startBatch.sh startBatch.sh就是脚本文件名
第三步:启动./startBatch.sh & 意思是关闭页面,后台运行
就完美运行成功!
这里写图片描述

猜你喜欢

转载自blog.csdn.net/qq_32447301/article/details/81109575
今日推荐