在阅读的过程中有不论什么问题,欢迎一起交流

邮箱:1494713801@qq.com   

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的更多相关文章

  1. SHELL syntax error:unexpected end of file 提示错误

    SHELL syntax error:unexpected end of file 提示错误 if [ -n "$1" ] then " else " fi e ...

  2. shell 报错:syntax error: unexpected end of file

    有时执行脚本时会报错: [root@host1 shell]# sh -x test.sh + $'\r' : command not found test.: syntax error: unexp ...

  3. 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- ...

  4. 报错解决——linux下执行sh出现异常"syntax error: unexpected end of file"

    有时我们在linux下执行一个sh文件,会报错“SYNTAX ERROR:UNEXPECTED END OF FILE”,这个现象主要是工作的系统环境改变造成的. 若最初脚本中是在windows下,使 ...

  5. win-Linux文件脚本迁移过程中的问题 syntax error: unexpected end of file

    问题:  在win下写好的shell脚本,放到Linux上测试sh -n报错如下 ORA_check.sh: line 251: syntax error: unexpected end of fil ...

  6. 解决执行脚本报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 ...

  7. 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 主 ...

  8. syntax error:unexpected end of file

    将window上编辑的xxy1.sh脚本上传到linux上,并执行的时候提示 xxy1.sh: line 17: syntax error: unexpected end of file 但是通过ca ...

  9. 页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久总算解决了

    页面白屏并且报错PHP Parse error:  syntax error, unexpected end of file in 试了很久 啥短标记,打开,都试了 最简单的办法 是重新建立一个文件, ...

随机推荐

  1. vpn技术原理详解

    转载于:http://blog.csdn.net/quqi99/article/details/7334617 假设有这样一个需求,需要从家中访问公司内网机器,可以用ssh遂道技术来作转发,遂道分正向 ...

  2. 三、IF...ELSE和缩进

    IF...ELSE和缩进 根据用户输入的不同做不同的事情 注意语法结尾的冒号. 例1: name = input("Please input your name:") if nam ...

  3. [ACM] HDU 5083 Instruction (模拟)

    Instruction Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Tota ...

  4. Android如何监听蓝牙耳机的按键事件

    写在前面: 直接想要代码很简单,你直接把滚动条拉到最底端就可以看到.如果想要十分地了解为什么,那就按照我规划的一步一步来理解.以下测试环境以手头上有的「Bluedio + 红米手机」. 1.蓝牙耳机的 ...

  5. JavaScript实现复制功能

    这两天在做Web前端时,遇到需求通过 js 实现文本复制的功能. 先不考虑浏览器的兼容性,看看各浏览器对复制功能的支持情况: 1.IE浏览器 ,解决方法有三种,代码如下: function copy( ...

  6. 多文件上传组件FineUploader使用心得

    原文 多文件上传组件FineUploader使用心得 做Web开发的童鞋都知道,需要经常从客户端上传文件到服务端,当然,你可以使用<input type="file"/> ...

  7. string和byte[]的转换 (C#)

    原文 string和byte[]的转换 (C#) string类型转成byte[]: byte[] byteArray = System.Text.Encoding.Default.GetBytes  ...

  8. 为什么出现Wide character in print at a14.pl line 41

    [root@wx03 ~]# cat a14.pl use Net::SMTP; use LWP::UserAgent; use HTTP::Cookies; use HTTP::Headers; u ...

  9. URAL 1707. Hypnotoad&#39;s Secret(树阵)

    URAL 1707. Hypnotoad's Secret space=1&num=1707" target="_blank" style="" ...

  10. POJ 1258-Agri-Net (Kruskal)

    题目链接:Agri-Net 最小生成树水题,数组开的和题目描写叙述一样,可是就是RE,有填了个0,还好这个题用 库鲁斯卡尔 敲了一遍,发现了点问题,曾经写的库鲁卡尔模板有点问题,多写了步没用的操作,已 ...