1.vi当前脚本

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

3.输入 :set ff=unix

4.输入 :wq

5.再执行即可


原因:

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