【问题解决】syntax error: unexpected end of file或-bash: ./full_build.sh: /bin/bash^M: bad interpreter: No
在阅读的过程中有不论什么问题,欢迎一起交流
QQ:1494713801
运行一个脚本full_build.sh 时, 一直是提示我:
-bash: ./full_build.sh: /bin/bash^M: bad interpreter: No such file or directory
或提醒 syntax error: unexpected end of file
出现上面错误的原因之中的一个是脚本文件是DOS格式的, 即每一行的行尾以\r\n来标识, 使用vim编辑器打开脚本, 执行:
:set ff?
能够看到DOS或UNIX的字样. 使用set ff=unix把它强制为unix格式的, 然后存盘退出, 就可以.
网上也有非常多的其它方法, 比方: 运行dos2unix 命令转换编码, 命令为: #dos2unix full_build.sh, 但我没有dos2unix的安装包, 所以就跳过了.
也有说造成这样的问题的解决办法是在使用vim时不小心按了个: Ctrl+v, 脚本是我从server上下的, 不清楚究竟怎么会变成了DOS格式的了. 总之攻克了即可啦.
【问题解决】syntax error: unexpected end of file或-bash: ./full_build.sh: /bin/bash^M: bad interpreter: No的更多相关文章
- SHELL syntax error:unexpected end of file 提示错误
SHELL syntax error:unexpected end of file 提示错误 if [ -n "$1" ] then " else " fi e ...
- shell 报错:syntax error: unexpected end of file
有时执行脚本时会报错: [root@host1 shell]# sh -x test.sh + $'\r' : command not found test.: syntax error: unexp ...
- 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- ...
- 报错解决——linux下执行sh出现异常"syntax error: unexpected end of file"
有时我们在linux下执行一个sh文件,会报错“SYNTAX ERROR:UNEXPECTED END OF FILE”,这个现象主要是工作的系统环境改变造成的. 若最初脚本中是在windows下,使 ...
- win-Linux文件脚本迁移过程中的问题 syntax error: unexpected end of file
问题: 在win下写好的shell脚本,放到Linux上测试sh -n报错如下 ORA_check.sh: line 251: syntax error: unexpected end of fil ...
- 解决执行脚本报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 ...
- 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 主 ...
- syntax error:unexpected end of file
将window上编辑的xxy1.sh脚本上传到linux上,并执行的时候提示 xxy1.sh: line 17: syntax error: unexpected end of file 但是通过ca ...
- 页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久总算解决了
页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久 啥短标记,打开,都试了 最简单的办法 是重新建立一个文件, ...
随机推荐
- c++ 重载,覆盖,重定义
写的不是很明白,后来又重新整理过了,在: http://www.cnblogs.com/iois/p/4986790.html 函数重载(Function Overloading) C++允许同一范围 ...
- xcode4.5.1、iphone5、ios6 使用记录
链接地址:http://blog.sina.com.cn/s/blog_6123f9650101dmo7.html 1.修改工程名:直接选中工程名点一下,就像修改名称夹名称一样简单了. 2.导入旧 ...
- python xpath
提取Item 选择器介绍 我们有很多方法从网站中提取数据.Scrapy 使用一种叫做 XPath selectors的机制,它基于 XPath表达式.如果你想了解更多selectors和其他机制你可以 ...
- 关于运行robotium提示连接不上jar问题
robotium运行测试helloworld报错: java.lang.NoClassDefFoundError: com.jayway.android.robotium.solo.Solo at c ...
- 西门子PLC学习笔记七-(位逻辑指令)
位逻辑指令处理的对象为二进制位信号.存储在状态字"RLO"中. 1.触点与线圈指令 1)常开触点 在PLC中规定:操作数为1,则常开触点"动作(闭合)":操作数 ...
- Join的实现步骤 以及连接的概念
Join的实现步骤 以及连接的概念 我们常说连接有三种,即 交叉连接.内连接.外连接,这三者的概念很容易模糊,现在我们先放下概念,搞清楚完整连接实现的步骤: 一个完整的连接有三个步骤:.做笛卡儿积: ...
- 配置用户范围settings.xml
Maven用户可以选择配置<<MavenHome>>/conf/settings.xml或者<<UserHome>>/.m2/settings.xml. ...
- 【解决方法】System.IO.FileNotFoundException
错误日志 See the end of this message for details on invoking just-in-time (JIT) debugging instead of thi ...
- iOS开发 - 应用内打开第三方应用并传值
首先说下这个功能, 应该都有接触过. 比方,你下载了一个电子书,然后选择打开方式的时候,可能会看到你手机中已经安装的阅读类App. 或者,你的QQ收到了某个文件,你也能够选择本地的应用来打开. 那这种 ...
- Winform - 判断GroupBox控件中的TextBox文本框是不是为空
foreach (Control item in this.groupBox2.Controls) { if (item is TextBox) { if (item.Text.Trim() == & ...