同一脚本sh 脚本名 执行时报Syntax error: "(" unexpected:而./脚本名执行不报错,为什么呢 脚本内容如下: function usage(){ echo "usage:$0 url" exit } function check_url(){ -T $ ] then echo "$1 is ok" else echo "$1 is not ok " fi } function main(){ ] t…
今天用make 编译 蹦到 bash ‘/bin/sh: Syntax error: “(” unexpected 和 /bin/sh: [[: not found 这种莫名奇妙的错误 原因是是linux将sh指向了dash而不是bash 直接改配置 dpkg-reconfigure dash 选默认不是dash…
在阅读的过程中有不论什么问题,欢迎一起交流 邮箱: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格式的, 即每一行的行尾以\…
编译文件的时候出现 /bin/sh: 1: syntax error: "(" unexpected 错误. 网上查到的资料都是: (1)在脚本前写#!/bin/bash (2)执行dpkg-reconfigure dash然后选No 然而做了这两步之后,同样的错误还是照样出现. 在Makefile中查到出问题的是make语句中的$(shell pwd)部分. 后来发现代码目录的目录名中包含了括号!把目录改名,去掉名字中的括号,恢复正常.…
昨天小猿我把Ubuntu Server64位上的 zookeeper换成了最新版本的,结果启动的时候出错:之前zookeeper-3.3.6是没有任何问题的,换成了zookeeper3.5出现了下面的错误: root@host8:/usr/solrcould/service1/zookeeper-3.5.0-alpha# sh bin/zkServer.sh start JMX enabled by default bin/zkServer.sh: 95: /usr/solrcould/serv…
在Ubuntu下执行脚本报错 c.sh: Syntax error: "(" unexpected 解决办法 sudo dpkg-reconfigure dash ubuntu@ip----:~$ ll /bin/sh lrwxrwxrwx root root Dec : /bin/sh -> dash*        …
在ubuntu电脑上安装lnmp环境,执行下面命令时 sudo sh ubuntu.sh 报错误:ubuntu.sh: 113: ubuntu.sh: Syntax error: "(" unexpected 原因: 兼容性问题,因为linux将sh默认指向了dash,而不是bash 解决办法:sudo dpkg-reconfigure dash 在弹出的窗口选择no 然后再重新执行 sudo sh ubuntu.sh就可以了…
写了个脚本用cat>>EOF报错如下: 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 原因:最后的EOF多了个空格,取消即可.…
有时我们在linux下执行一个sh文件,会报错“SYNTAX ERROR:UNEXPECTED END OF FILE”,这个现象主要是工作的系统环境改变造成的. 若最初脚本中是在windows下,使用sublime编辑器写.将shell脚本传至linux中:使用命令bash -x SCRIPT检查语法总是出一个错误 syntax error:unexpected end of file. 原因:dos文件传输到unix系统时,会在每行的结尾多一个^M,在vim的时候,当你用如下命令查看:cat…
Shell script fails: Syntax error: “(” unexpected google 一下. http://unix.stackexchange.com/questions/45781/shell-script-fails-syntax-error-unexpected The script does not begin with a shebang line, so the kernel executes it with /bin/sh. On Ubuntu, /bi…