码迷,mamicode.com
首页 > 其他好文 > 详细

syntax error:unexpected end of file

时间:2016-12-09 22:15:08      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:执行   err   步骤   error:   window   linu   回车   end   ref   

将window上编辑的xxy1.sh脚本上传到linux上,并执行的时候提示
xxy1.sh: line 17: syntax error: unexpected end of file
但是通过cat xxy1.sh查看脚本的时候,未发现语法异常,找了度娘后知道
原来是window和linux的文件格式不同导致,解决办法就是
(1)vi xxy1.sh
(2)按下键盘Esc键,按下键盘“:”冒号键
(3)输入:set fileformat=unix,后回车
(4)重复步骤2,输入:wq,后回车
在sh xxy1.sh即可正常执行脚本了




syntax error:unexpected end of file

标签:执行   err   步骤   error:   window   linu   回车   end   ref   

原文地址:http://www.cnblogs.com/xxyBlogs/p/6151685.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!