原因:windows和linux的sh文件格式不同。以换行为例,windows是\r\n,而Linux是\n。所以linux运行windows的sh文件会报错’\r’: command not found
解决办法:使用Vim打开文件,进行如下设置后即可正常运行。
:set ff=unix
:wq