linux-shell syntax error: unexpected end of file

来源:互联网 发布:淘宝图库素材网打不开 编辑:程序博客网 时间:2024/05/15 17:04

写shell脚本,如果在windows上面写,通过ftp上传到linux上面

运行时,报:

syntax error: unexpected end of file

是因为脚本文件在windows编写,windows会在每行自动加上一个windows结束符

将文件重新保存成unix格式即可

用vi打开脚本,然后输入:,再输入set fileformat=unix 

保存即可



0 0
原创粉丝点击