LINUX下执行脚本:/bin/sh^M: bad interpreter: No such file or directory 异常

来源:互联网 发布:c 从入门到精通 源码 编辑:程序博客网 时间:2024/06/10 04:05

1.vi当前脚本

2.输入 :set ff,看输出结果, 应该是fileformat=dos

3.输入 :set ff=unix

4.输入 :wq

5.再执行即可


原因:

脚本文件是在windows下编写的.文件格式是dos的,需要转换成unix格式

0 0
原创粉丝点击