运行shell脚本报错“do_run.sh: line 14: syntax error: unexpected end of file”
原因:该脚本在windows下编辑或者在windows打开保存过。
DOS下文件和Linux下文件格式差异问题导致的。
DOS下的文本文件是以\r\n作为断行标志的,表示成十六进制就是0D 0A。而Unix下的文本文件是以\n作为断行标志的,表示成十六进制就是0A。
解决方法:
使用下面的命令将文件格式设置为unix格式即可解决上述错误。
vi M.txt
:set fileformat=unix
:wq
源:http://blog.csdn.net/zhuying_linux/article/details/7736201
相关推荐
CentOS 7运行.sh脚本提示syntax error: unexpected end of file。脚本是通过本地电脑的notepad++编辑之后用ftp上传到CentOS 7服务器上的。 错误原因: shell脚本在本地电脑编辑的,格式是dos(可以用vi编辑该shell...
异常详细信息: EnterpriseDT.Net.Ftp.FTPException: plan/??_SV_201011121502.DNJH: The filename, directory name, or volume label syntax is incorrect
start.sh: line 17: syntax error near unexpected token `$'do\r'' 'tart.sh: line 17: ` do 原因 运行cat -v start.sh,如果内容结尾为是^M,这是因为你所处理的文件换行符是dos格式的”\r\n”,你可能在windows...
GBase数据库初始化脚本
在外部使用var就报错Parse error: syntax error, unexpected T_VAR in…,例如我的出错信息: Parse error: syntax error, unexpected T_VAR in D:\Apache2.2\htdocs\shirdrn\page\p2\pageUtil.inc on line 34 我在...
主要介绍了Vue项目报错:Uncaught SyntaxError: Unexpected token <,在引入第三方依赖的 JS 文件时,遇到的一个问题,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
控制台的提示:Uncaught SyntaxError: Unexpected token < 按照提示进入文件,再看如下图: 仔细看了看 index.html 文件,发现原本我的 JS 文件是放在 /src/utils 文件夹下的,但引入 /src 和 /static 的文件是...
用于Verilog和SystemVerilog的Vim语法插件关于基于最初在以下位置找到的脚本:重要通知3.0版审查了此插件中使用的配置变量。 因此,请考虑以下变量已被弃用并且不再受支持: b:verilog_indent_modules b:verilog_...
同事在使用python3操作sqlite时出现了异常,具体代码缩减如下: import sqlite3 conn = sqlite3.connect('star.db') cursor = conn.cursor() insert_sql = 'insert into user(id,name) values (%s,%s)' ...
STM32f10x系列的startup文件(.s文件),从例程代码里拿出来的,方便以后自己找。 ps.貌似必须收费至少1分啊。。。
该文件可以用于解决启动verdi后的报错,verdi/platform/LINUXAMD64/bin/ Novas: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory 注意适用于64...
今天在写PHP程序的时候总是出现这样的错误:Parse error: syntax error, unexpected end of file in *.php on line *,然后我就根据提示,找到那个文件,然后错误中总是提示最后一行出错,我找到最后一行发现是<...
unity 打包web包报错:Uncaught SyntaxError: Unexpected token '在打包文件添加此配置文件。 <system.webServer> <remove fileExtension=".png" /> <mimeMap fileExtension=".memgz" mimeType="application/...
linuxqq_2.0.0-b2-1089_amd64.deb
数据库疑难杂症 java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘order’ at line...
SyntaxError: Unexpected identifier at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:542:28) at Object.Module._extensions..js (module.js:579:10) ...
Fixed AUTO_CREATE_STATISTICS syntax. Fixed snapshot_option syntax. SP-6946 : We notify about errors outside the selected text when inserting semicolons. SP-6962 : Formatting no longer applies an ...