bin/sh^M: bad interpreter

bin/sh^M: bad interpreter: No such file or directory解决

问题:bin/sh^M: bad interpreter: No such file or directoryhtml

缘由:.sh脚本在windows系统下用记事本文件编写的。不一样系统的编码格式引发的。git

解决方法:修改.sh文件格式windows

 

   (1)使用vi工具bash

 

      vi test.sh工具

 

    (2)利用以下命令查看文件格式 编码

     :set ff 或 :set fileformat spa

     能够看到以下信息 unix

     fileformat=dos 或 fileformat=unix orm

     (3) 利用以下命令修改文件格式 htm

     :set ff=unix 或 :set fileformat=unix 

     :wq (存盘退出)

 

注:其实,在windows下经过git bash能够直接编写unix格式.sh!

相关文章
相关标签/搜索