syntax error: unexpected end of file
用shell编写的一个脚本,执行的时候报错:syntax error: unexpected end of file!发生这种报错有两种原因:第一种:如果你是用 windows 系统编写的脚本,那么就有可能是 fileformat 类型不同!可能是 fileformat=dos ,那么你需要把格式修改为unix,方法是直接输入 :set ff=unix,输入完成后回车即可看到:fileformat=unix第二种:如果你是用 Linux 系统编写的 shell 脚本,在 vim 的命令