日期:2014-05-16  浏览次数:20607 次

Ubuntu shell 声明数组
在shell中声明数组:databaseTable=(0 1 2 3)时提示Syntax error: "(" unexpected 。后来添加声明:declare -a databaseTable=(0 1 2 3);提示同样的错误,SHELL版本:4.2.10(1)-release !求解……
------解决方案--------------------
ubuntu 的/bin/sh 是默认连接的dash

你用/bin/bash或者./执行就行了,别直接用sh执行
或者把连接改成bash