【问题解决】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 试了很久 啥短标记,打开,都试了 最简单的办法 是重新建立一个文件, ...
随机推荐
- initialize和init区别
Objective-C很有趣的一个地方是,它非常非常像C.实际上,它就是C语言加上一些其他扩展和一个运行时间(runtime). 有了这个在每个Objective-C程序中都会起作用的附加运行时间,给 ...
- ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables opt
mysql跳过权限: mysqld -nt --skip-grant-tables opt 登录:mysql -uroot -p 修改root密码 set password for 'root'@'l ...
- uboot代码2:stage2代码,启动内核
一.uboot最终目的: 1.读出内核 do_nand read kernel { flash上存的内核:uImage = 头部 + 真正的内核; } 2.启动内核. do_bootm_linux { ...
- loadrunner参数化总结
Select next row:Sequential,Rondom,Unique Update value on:Each iteration,Each occurrence,Once 下面分别对这两 ...
- 云计算被视为继大型计算机、个人计算机、互联网之后的第4次IT产业革命,顺应了当前各行业整合计算资源和服务能力的要求(转)
云计算被视为继大型计算机.个人计算机.互联网之后的第4次IT产业革命,顺应了当前各行业整合计算资源和服务能力的要求,成为引领当今世界信息技术变革的主力军.越来越多的金融企业认识到只有与云计算结合,才能 ...
- premake在Ubuntu和GCC环境下创建简单的C++工程
由于premake基于lua脚本,为了方便编辑lua脚本,我在emacs24中利用package system安装了lua-mode. 然后创建config.lua文件,填入下面这段,主要来自:htt ...
- poj 3466 A Simple Problem with Integers
题目链接:http://poj.org/problem?id=3468 http://poj.org/problem?id=3468 http://poj.org/problem?id=3468 思路 ...
- jqueryui datepicker refresh
http://stackoverflow.com/questions/6056287/jquery-ui-datepicker-prevent-refresh-onselect 给选中的TD加背景色
- javascript模板引擎之artTemplate 学习笔记
<div id="content"></div><div id="content1"></div><h1& ...
- 如何编译tizen源码(图文教程)?
前一篇文章已经介绍了如何下载tizen源码,下面我将继续讲述如何编译源码. 1 下载安装gbs编译工具 tizen源码是用gbs工具进行编译的,因此我们首先得将此工具下载下来,并且设置好. 下面的Ub ...