src:http://www.2cto.com/os/201308/238962.html

 
执行某bash脚本是发生: syntax error: unexpected end of file
主要问题是由windows下拷出文件到linux下执行的结果,
 
因为windows某些文件格式与Linux并不是完全兼容,两种方法解决:
 
1.vim处理
 
:set fileformat=unix
 
:wq
 
2使用dos2unix工具
 
dos2unix file
------------------------------------------------------------------------
src:http://simon-zzm.blog.163.com/blog/static/88809522201041611312117/
启动失败

使用./haproxy –f /usr/local/haproxy/haproxy.cfg –d启动系统报错如下:

Starting haproxy: [ALERT] 015/191034 (15631) : Starting proxy webfarm: cannot bind socket...on both load balancers

[ALERT] 056/103843 (1358) : Starting proxy www-balancer: cannot bind socket

解法方法:

修改# vi /etc/sysctl.conf

net.ipv4.ip_nonlocal_bind=1

保存结果,使结果生效

# sysctl –p

shell:syntax error:unexpected end of file/Starting proxy www-balancer: cannot bind socket--转载的更多相关文章

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

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

  2. 【LINUX】SHELL syntax error:unexpected end of file

    解决思路: DOS下文件和Linux下文件格式差异问题导致的. DOS下的文本文件是以\r\n作为断行标志的,表示成十六进制就是0D 0A.而Unix下的文本文件是以\n作为断行标志的,表示成十六进制 ...

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

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

  4. 【shell】真正解决syntax error:unexpected end of file?

    今天写了个较长的shell脚本,结构嵌套比较多,最后运行时,出现了syntax error: unexpected end of file的错误. 这个之前碰到过,经常在win系统转移脚本文件到uni ...

  5. 执行shell脚本报错:syntax error near unexpected token `或syntax error: unexpected end of file

    引起此问题最可能的原因是: 在windows下编写的文件上传到linux执行. 我是在notepad++上编写的代码,之后上传到linux执行,报此错误.仔细检查,语法方面没有错误.上网查了一下,发现 ...

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

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

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

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

  8. $'\r': command not found 或者 syntax error: unexpected end of file 或者 syntax error near unexpected token `$'\r''

    执行shell脚本如果报如下错误: syntax error near unexpected token `$'\r'' syntax error: unexpected end of file $' ...

  9. syntax error: unexpected end of file完美解决方案

    用shell编写的一个脚本,执行的时候报错:syntax error: unexpected end of file! 发生这种报错有两种原因: 第一种: 如果你是用 windows 系统编写的脚本, ...

随机推荐

  1. Keil5编译STM32注意事项

    硬件:某STM32开发板,ST-Link/V2 一.硬件相关: 1.引脚连接: pin7 <-> SWIO pin9 <-> SWCLK pin20/pin18 <-&g ...

  2. Spring Boot 应用系列 3 -- Spring Boot 2 整合MyBatis和Druid,多数据源

    本文演示多数据源(MySQL+SQL Server)的配置,并且我引入了分页插件pagehelper. 1. 项目结构 (1)db.properties存储数据源和连接池配置. (2)两个数据源的ma ...

  3. CC2530学习路线-基础实验-定时器控制LED灯亮灭(3)

    目录 1. 前期预备知识 1.1 定时器中断触发 1.2 相关寄存器 1.3 寄存器相关问题 1.4 T1.T3定时器初始化流程 2 程序及代码 THE END 1. 前期预备知识 1.1 定时器中断 ...

  4. python远程执行命令

    def run(): try: ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ...

  5. dpdk EAL: Error reading from file descriptor 23: Input/output error

    执行test程序时输出: EAL: Error reading from file descriptor 23: Input/output error 原因: 在虚拟机添加的网卡,dpdk不支持导致的 ...

  6. Sentinel 哨兵 实现redis高可用

    本文链接:http://www.cnblogs.com/zhenghongxin/p/8885879.html 我们知道redis是有主从复制的,例如下图: 但如果master主进程挂掉之后,没有sl ...

  7. Mac 忘记密码

    今天早上到公司发现电脑被动过,马上查看浏览器的历史记录,果然发现了一些痕迹.虽然是公司的电脑,但是随便被人翻看,还是很不爽! 于是马上把原来公司给的默认密码改掉. 不料,中午出去吃了个饭,回来就把密码 ...

  8. 在Load average 高的情况下如何鉴别系统瓶颈

    在Load average 高的情况下如何鉴别系统瓶颈.是CPU不足,还是io不够快造成? 或是内存不足? 一:查看系统负载vmstat procs -----------memory-------- ...

  9. jsp页面,jstl标签中的数据在<%%>java中使用

    可参考jsp的API隐式对象.. 这部分数据其实被保存在page域中,但jsp中如果使用java代码需要在特定的标签中<%%>,在这个标签中可使用的只有pageContext对象,所以可以 ...

  10. byte范围及8种常见数据类型

    byte范围:-128  到 127 原因 : 在计算机内,定点数有3种表示法:原码.反码和补码 原码 :二进制定点表示法,即最高位为符号位,“0”表示正,“1”表示负,其余位表示数值的大小. 反码 ...