shell脚本运行报错:-bash: xxx: /bin/sh^M: bad interpreter: No such file or directory

https://blog.csdn.net/yamaxifeng_132/article/details/71105311

主要原因是test.sh是我在windows下编辑然后上传到linux系统里执行的。.sh文件的格式为dos格式,而linux只能执行格式为unix格式的脚本。

原文地址:https://www.cnblogs.com/macyzhang/p/10373381.html