将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的更多相关文章

  1. SHELL syntax error:unexpected end of file 提示错误

    SHELL syntax error:unexpected end of file 提示错误 if [ -n "$1" ] then " else " fi e ...

  2. 【问题解决】syntax error: unexpected end of file或-bash: ./full_build.sh: /bin/bash^M: bad interpreter: No

    在阅读的过程中有不论什么问题,欢迎一起交流 邮箱:1494713801@qq.com    QQ:1494713801 运行一个脚本full_build.sh 时, 一直是提示我: -bash: ./ ...

  3. shell 报错:syntax error: unexpected end of file

    有时执行脚本时会报错: [root@host1 shell]# sh -x test.sh + $'\r' : command not found test.: syntax error: unexp ...

  4. input01.sh: line 11: warning: here-document at line 4 delimited by end-of-file (wanted `EOF') input01.sh: line 12: syntax error: unexpected end of file

    写了个脚本用cat>>EOF报错如下: input01.sh: line 11: warning: here-document at line 4 delimited by end-of- ...

  5. 报错解决——linux下执行sh出现异常"syntax error: unexpected end of file"

    有时我们在linux下执行一个sh文件,会报错“SYNTAX ERROR:UNEXPECTED END OF FILE”,这个现象主要是工作的系统环境改变造成的. 若最初脚本中是在windows下,使 ...

  6. win-Linux文件脚本迁移过程中的问题 syntax error: unexpected end of file

    问题:  在win下写好的shell脚本,放到Linux上测试sh -n报错如下 ORA_check.sh: line 251: syntax error: unexpected end of fil ...

  7. 解决执行脚本报syntax error: unexpected end of file或syntax error near unexpected token `fi'错误的问题

    参考:https://blog.csdn.net/u012453843/article/details/69803244 解决执行脚本报syntax error: unexpected end of ...

  8. shell:syntax error:unexpected end of file/Starting proxy www-balancer: cannot bind socket--转载

    src:http://www.2cto.com/os/201308/238962.html   执行某bash脚本是发生: syntax error: unexpected end of file 主 ...

  9. 页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久总算解决了

    页面白屏并且报错PHP Parse error:  syntax error, unexpected end of file in 试了很久 啥短标记,打开,都试了 最简单的办法 是重新建立一个文件, ...

随机推荐

  1. 补交20145226蓝墨云班课 -- MyOD

    蓝墨云班课 -- MyOD.java 具体描述: 编写MyOD.java 用java MyOD XXX实现Linux下od -tx -tc XXX的功能. 提交测试代码和运行结果截图,加上学号水印,提 ...

  2. cnn 滤波

    http://blog.csdn.net/zouxy09/article/details/49080029

  3. 15-[JavaScript]-ECMAScript 1

    0.javaScript的发展历程 https://zhuanlan.zhihu.com/p/27985124 1.javaScript是什么? javaScript是一种web前端的描述语言,也是一 ...

  4. cogs1889 [SDOI2008]Cave 洞穴勘测 link-cut tree

    link-cut tree // It is made by XZZ #include<cstdio> #include<algorithm> #define il inlin ...

  5. android targetSdkVersion>=26收不到广播的处理

    背景:GP新政策,要求Google Player上架应用的targetSdkVersion>=26. 一. 为啥GP要求targetSdkVersion>=26? 1 targetSdkV ...

  6. 约束3:default约束

    默认值约束(Default约束)的作用是在执行insert命令时,如果命令没有显式给指定的列赋值,那么把默认约束值插入到该列中:如果在Insert命令中显式为指定的列赋值,那么将该列插入用户显式指定的 ...

  7. 中间介(MiddleWare)

    引子-Django的生命周期 在学习中间介之前,我们先来回顾一下Django的生命周期:用户发起请求,请求会被发送到urlconf中的url,然后会指向对应的views函数进行处理,views函数处理 ...

  8. IO多路复用多并发服务器模板

    import socket import selectors # IO多路复用选择器 epoll_selector = selectors.EpollSelector() # 实例化选择器 serve ...

  9. MapReduce任务学习系列

    首先放一张官方图片,大致了解下整个MapReduce的处理过程. 抛出如下疑问: 1.MapReduce的基本原理是什么?即利用什么机制来实现的任务拆分处理? 2.MapReduce任务执行过程是什么 ...

  10. 基础的 sparkSQL操作

    spark连接mysql操作 数据库jdbc 连接封装 package test.com import org.apache.spark.sql.{DataFrame, SparkSession} / ...