linux-shell syntax error: unexpected end of file

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

运行时,报:

syntax error: unexpected end of file

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

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

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

保存即可



猜你喜欢

转载自blog.csdn.net/skyhh/article/details/46124987
今日推荐