标签:inter .sh bad cat https ons duplicate bash 命令
参考:-bash: ./my_script: /bin/bash^M: bad interpreter: No such file or directory [duplicate]
有的时候运行.sh文件会莫名其妙报错,报错信息如下:
$ ./scriptname.sh
-bash: ./scriptname.sh: /bin/bash^M: bad interpreter: No such file or directory
解决办法:运行如下命令
$sed -i -e 's/\r$//' scriptname.sh
之后再次运行sh文件即可
$ ./scriptname.sh
/bin/bash^M: bad interpreter: No such file or directory 解决办法
标签:inter .sh bad cat https ons duplicate bash 命令
原文地址:https://www.cnblogs.com/marsggbo/p/10102863.html