原因在于 windows 下的换行符是 \r\n,而 linux 下的换行符是 \n
解决方案:
首先运行如下命令安装 dos2unix:
yum install dos2unix -y
接下来运行如下命令进行转换工作:
dos2unix file.sh
完成转换后便可正常执行脚本。
时间:2019-02-25 09:23:29
原因在于 windows 下的换行符是 \r\n,而 linux 下的换行符是 \n
解决方案:
首先运行如下命令安装 dos2unix:
yum install dos2unix -y
接下来运行如下命令进行转换工作:
dos2unix file.sh
完成转换后便可正常执行脚本。