Ubuntu shell 宣言数组

Ubuntu shell 宣言数组

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

Ubuntu shell 宣言数组

相关文章:

你感兴趣的文章:

标签云: