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, /bin/sh is dash, a shell designed for fast startup and execution with only standard features. When dash reaches line 68, it sees a syntax error: that parenthesis doesn't mean anything to it in context.

Since dash (like all other shells) is an interpreter, it won't complain until the execution reaches the problematic line. So even if the script successfully started at some point in your testing, it would have aborted once line 68 was reached.

The shebang line must be the very first thing in the file. Since you use bash features, the first line of the file must be #!/bin/bash or #!/usr/bin/env bash.

就是把第一行改为 #!/bin/bash 或者  #!/usr/bin/env bash  

最新文章

  1. java 读文件路径问题
  2. hdu 4826(dp + 记忆化搜索)
  3. XML Basic
  4. curl测试网页响应时间
  5. 请不要做浮躁的IT人
  6. 如何使用新浪微博账户进行应用登录验证(基于Windows Azure Mobile Service 集成登录验证)
  7. [转载]SharePoint 2013 解决方案中使用JavaScript
  8. poi读写word模板 / java生成word文档
  9. css两个form不换行,两个div并排代码
  10. HDU 2586 + HDU 4912 最近公共祖先
  11. 自动生成proto Js语句
  12. css关键字unset
  13. 计算机网络之IP协议族
  14. Chapter 2 User Authentication, Authorization, and Security(7):创建和使用用户自定义服务器角色
  15. javascript的加减乘除结果会有误差,在两个浮点数相加的时候会比较明显。以下函数返回较为精确的计算结果
  16. EBS WEBADI导入日记账 客户化账户组合规则校验
  17. HTML5 加密和摘要算法(base64,md5, sha1,rsa)
  18. 【npm】伙计,给我来一杯package.json!不加糖
  19. 【English】20190307
  20. 分布式Redis缓存串讲(一)

热门文章

  1. linux反弹shell
  2. 第一百零九节,JavaScript面向对象与原型
  3. 浅谈MAIC 2016第二届移动应用(APP)创新大会
  4. 《JS权威指南学习总结》
  5. page,request,session,application四个域对象的使用及区别
  6. notepad 是doc 调出记事本文件
  7. 老oj1965:polygon半平面交
  8. HDU 2955 Robberies(01背包)
  9. mariaDB安装完成后设置root密码等初始化操作
  10. robotium和appium的一些区别