set ff=unix

来源:互联网 发布:三星固态硬盘优化软件 编辑:程序博客网 时间:2024/06/05 18:28

在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory。


原因很可能是你在windows下编写的脚本文件,放到Linux中无法识别格式


解决方法:

用vi打开脚本文件,在命令模式下输入

set ff=unix


完!!