【问题解决】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://blog.chinaunix.net/uid-14022540-id-2849095.html 1.宏中"#"和"##"的用法 一.一般用法 ...
- BZOJ 1305: [CQOI2009]dance跳舞( 最大流 )
云神代码很短...0 ms过的...看了代码 , 大概是贪心... orz 我不会证 数据这么小乱搞就可以了吧... ←_← 这道题网络流还是可以写的... 既然限制了最多只能和 k 个不喜欢的人da ...
- 几种能在O(n*log(n))时间排序
线性时间排序 各种排序算法总结已经介绍了几种能在O(n*log(n))时间内培训n个数的算法.归并排序和堆排序达到了最坏情况下的上界:快速排序在平均情况下达到该上界.这些算法都有一个有趣的性质:在 ...
- JVM调优总结(二)-一些概念
Java对象的大小 基本数据的类型的大小是固定的,这里就不多说了.对于非基本类型的Java对象,其大小就值得商榷. 在Java中,一个空Object对象的大小是8byte,这个大小只是保存堆中一个没有 ...
- 编译kernel:编译
韦东山Linux视频第1期_裸板_UBoot_文件系统_驱动初步第10课第3节 内核启动流程分析之Makefile.WMV 1. 编译内核分三步: make xxx_defconfig [linux ...
- c语言,数组和指针
概要: 1.普通数组与指针 2.数组指针 3.指针的数组 数组是一个由(同一类型)连续元素组成的预先分配的内存块:指针是一个对任何位置的元素的引用. 数组自动分配空间,但不能重分配或改变大小:指针必须 ...
- Mysql zip 安装(windows)
Mysql Windows zip包安装 Mysql 下载地址: http://dev.mysql.com/downloads/mysql/ 下载windows 版本对应的zip,之后解压 在C:\P ...
- 1352 - Colored Cubes (枚举方法)
There are several colored cubes. All of them are of the same size but they may be colored differentl ...
- hdu 4117 GRE Words (ac自动机 线段树 dp)
参考:http://blog.csdn.net/no__stop/article/details/12287843 此题利用了ac自动机fail树的性质,fail指针建立为树,表示父节点是孩子节点的后 ...
- android launcher开发之图标背景以及默认配置
1:然后我自己看了一下桌面图标的载入过程: 桌面第一次载入时是默认读取一个xml配置文件,完毕配置工作.这个配置文件在Launcher文件夹下, 路径是:\Launcher\res\xml\defau ...