由于Linux和Windows中的换行符不同,Linux中执行Windows中编辑的.sh文件可能会报 ”$'\r': 未找到命令“
解决很轻松:
1、Linux中安装工具:yum install -y dos2unix
2、执行:dos2unix xxx.sh 转换格式
3、执行脚本:./xxx.sh
由于Linux和Windows中的换行符不同,Linux中执行Windows中编辑的.sh文件可能会报 ”$'\r': 未找到命令“
解决很轻松:
1、Linux中安装工具:yum install -y dos2unix
2、执行:dos2unix xxx.sh 转换格式
3、执行脚本:./xxx.sh