/***************************************************************************
 *                      [: xxxx: Unexpected operator
 * 说明:
 *     在修改shell脚本的时候遇到这个问题,记录一下解决方法。
 *
 *                                      2017-2-7 深圳 南山平山村 曾剑锋
 **************************************************************************/

一、参考文档:
    1. [ :Unexpected operator in shell programming [duplicate]
        http://stackoverflow.com/questions/3411048/unexpected-operator-in-shell-programming

二、解决办法:
    1. 原因:There is no mistake in your bash script. But you are executing it with sh which has a less extensive syntax。
    2. 将shell脚本第一行#!/bin/sh换成#!/bin/bash

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-05
猜你喜欢
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2021-10-09
  • 2021-09-08
  • 2021-10-12
  • 2022-12-23
相关资源
相似解决方案