Skip to content

Instantly share code, notes, and snippets.

@bladelee
Created July 17, 2014 06:07
Show Gist options
  • Save bladelee/06838f34a1c2e64cc207 to your computer and use it in GitHub Desktop.
Save bladelee/06838f34a1c2e64cc207 to your computer and use it in GitHub Desktop.
configure执行错误
bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory
在Redhat AS5上编译安装某软件,输入命令./configure后,提示“bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory”。
最后在网上查找了,分析认为此文件是在window下写的,所以在每行后面会加个ctrl+m就是^M,所以后面的sh就变成sh^M当然是没有这个命令的,所以脚本就不能运行了,把^M去掉就应该没问题了。
输入命令:dos2unix configure 把它转化成linux文件。
如果没有dos2unix此命令,可用此方法:
cat ./configure.sh | tr -d ‘\r’ > temp.sh
mv temp.sh configure.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment