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. SQL反模式-1

    SQL反模式讲了很多数据库设计中遇到的难题.跟我最近的工作很相关.因此特意拜读了下.本文主要讲解"多值列"和"幼稚的树" 多值列要分成映射表,比如(A,B),其 ...

  2. linux系统编程之文件与IO(六):实现ls -l功能

    本文利用以下系统调用实现ls -l命令的功能: 1,lstat:获得文件状态, 2,getpwuid: #include <pwd.h> struct passwd *getpwuid(u ...

  3. [Xamarin]我的Xamarin填坑之旅(一)

    一想到明天是星期五,不对,是今天,心里就很激动,毕竟明天没课.激动之余,来写一篇博客,记录一下最近踏坑Xamarin开发校园助手APP的一些事儿.也许更像是一篇流水账. 在扯Xamarin之前,有必要 ...

  4. Day71 分页,cookie and Session

    cookie 是保存在客户端的键值对. cookie本身最大支持4096字节,保存在客户端的 session是保存在服务器端的键值对.(依赖cookie) cookie和session cookie的 ...

  5. 20164317《网络对抗技术》Exp3 免杀原理与实践

    一.实验要求 1.1 正确使用msf编码器(0.5分),msfvenom生成如jar之类的其他文件(0.5分),veil-evasion(0.5分),加壳工具(0.5分),使用shellcode编程( ...

  6. python IPv6 十进制和十六进制互转

    IPv6 转 十进制: #!/usr/bin/python # -*- coding: UTF-8 -*- import re def ipv62dec(ipv6): if checkipv6(ipv ...

  7. Pacemaker 介绍

    1. 简介 Pacemaker是一个集群资源管理者.他用资源级别的监测和恢复来保证集群服务(aka.资源)的最大可用性.它可以用你所擅长的基础组件(Corosync或者是Heartbeat)来实现通信 ...

  8. A Tool to Clip Images

    using Microsoft.Win32; using System; using System.IO; using System.Text.RegularExpressions; using Sy ...

  9. 1007. Minimum Domino Rotations For Equal Row

    In a row of dominoes, A[i] and B[i] represent the top and bottom halves of the i-th domino.  (A domi ...

  10. Java线程代码实现

    线程的Java实现 参考博客:(http://www.importnew.com/20672.html) 1.继承Thread 声明Thread的子类; 这种方法是创建类继承Thread,然后重写Th ...