sh脚本异常:bad interpreter: No such file or directory
命令查看文件格式
:set ff 或 :set fileformat
可以看到如下信息
fileformat=dos 或 fileformat=unix
利用如下命令修改文件格式
:set ff=unix 或 :set fileformat=unix
:wq (存盘退出)
最后再执行文件
#sh>./filename
:set ff 或 :set fileformat
可以看到如下信息
fileformat=dos 或 fileformat=unix
利用如下命令修改文件格式
:set ff=unix 或 :set fileformat=unix
:wq (存盘退出)
最后再执行文件
#sh>./filename
////////////////////////////////////////////////////
解决了:configure是在window下写的,所以在每行后面会加个ctrl+m就是^M,所以后面的,sh就变成sh^M当然是没有这个命令的,所以脚本就不能运行了,把^M去掉就应该没问题了
cat ./configure | tr -d '\r' > temp
mv temp configure
sudo chmod +x configure
./configure
make
cat ./configure | tr -d '\r' > temp
mv temp configure
sudo chmod +x configure
./configure
make