zoukankan      html  css  js  c++  java
  • shell 报错 /bin/bash^M: bad interpreter: No such file or directory

    shell 执行报错:

    ./test.sh: /bin/bash^M: bad interpreter: No such file or directory

     原因:window和linux 的文件格式不同,这个问题是:linux换行只需要 /n windows的换行是 /r/n

    导致文件不能识别。

    vim 查看文件格式:  

    set ff?

    fileformat=dos

    就是window 的文件格式

    修改:

    set fileformat=unix

    搞定

  • 相关阅读:
    Linux
    Linux
    Linux
    Linux
    Linux
    shell tr命令
    grep 正则表达
    shell 运算符
    shell 重定向
    bzoj 1026 DP,数位统计
  • 原文地址:https://www.cnblogs.com/Springmoon-venn/p/7977012.html
Copyright © 2011-2022 走看看