`

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

 
阅读更多
Windows编写的文件到linux下,在执行脚本的时候会出现问题:

原因是:fileformat=dos


     方法1:vim x.sh进入x.sh后, 在底部模式下, 执行:set fileformat=unix后执行:x或者保存修改。 然后就可以执行./x.sh运行脚本了

     方法2:直接执行sed -i "s/\r//" x.sh来转化, 然后就可以执行./x.sh运行脚本了

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics