/usr/bin/env: bash: No such file or directory 解决办法

1,155 阅读1分钟
  1. GitWindows上将gradlew的行结尾从Unix样式(LF)转换为Windows样式(CRLF)
  2. windows下新建的sh文件,copylinux下有的也会报错

解决方法:

一. 根除问题(注意:会删仓库!)
  1. rm -rf .git
  2. git config --global core.autocrlf false 禁用自动转换
  3. git init
  4. git add xxx.xx
二. 临时解决问题
  1. vim 出现问题的.sh
  2. :set fileformat=unixset ff=unix 设置成unix格式

set ffset ff? 显示当前文件格式

参考链接