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. dubbo在eclipse中无法读取到dubbo.xsd

    报错信息如下: Multiple annotations found at this line:– cvc-complex-type.2.4.c: The matching wildcard is s ...

  2. C99 中 main 函数的写法

    今天在论坛看见有人讨论 C 语言中 main 函数的写法,看到结论才知道 main 函数的正确写法. 被老谭酸菜坑了这么多年,还是记录下吧,或许以后某天不搞 .net,回去折腾 C 语言了. 写法1: ...

  3. test命令详解

    test命令格式: test condition 通常,在if-then-else语句中,用[]代替,即[ condition ].注意:方括号两边都要用空格.   1.数值比较 ========== ...

  4. Django:form.save()方法

    参考:https://blog.csdn.net/it_yuan/article/details/53580756 背景: 之前的博客是不支持上传文章缩略图的,后来新增了此功能,但是发现修改老的文章时 ...

  5. C# Linq 学习笔记

    刚刚学习了 Siki老师 的C#教程Linq部分,以下是笔记 需要引用命名空间 using System.Linq; 然后我们需要准备数据 武林高手类 /// <summary> /// ...

  6. 构建NetCore应用框架之实战篇(六):BitAdminCore框架架构小结

    本篇承接上篇内容,如果你不小心点击进来,建议从第一篇开始完整阅读,文章内容继承性连贯性. 构建NetCore应用框架之实战篇系列 一.小结 1.前面已经完成框架的第一个功能,本篇做个小结. 2.直接上 ...

  7. winform NPOI excel 导出并选择保存文件路径

    public void ExcelOp(DataGridView gdv,ArrayList selHead) { if (selHead.Count==0) { MessageBox.Show(&q ...

  8. wpf ,只能窗口调整高度,并且设定最小值。

    MaxWidth="900" WindowStyle="ToolWindow" ResizeMode="CanResize" WindowS ...

  9. WPF 自定义快速实现线程等待函数FastTask

    在WPF实现 我们常常需要实现这个目标:线程里面执行复杂的任务,然后主窗体等待动画 我把我最简单的东西给包了一下,更方便使用,大家也可以方便使用 1:添加CommHelper类 FastTask方法 ...

  10. sql表与表之间的数据操作

    --把一张表的内容更新到另一张表 update 表1 set 表1.Store=t2.Name from 表2 t2 where 表1.id=t2.id --备份一张表 create table ta ...