linux bash shell之declare

一、
#Set the right GC options based on the what we are running
declare -a server_cmds=("master" "regionserver" "thrift" "thrift2" "rest" "avro" "zookeeper")
for cmd in ${server_cmds[@]}; do
        if [[ $cmd == $COMMAND ]]; then
                server=true
                break
        fi
done
解释======>
-a 数组
declare -a indices
变量indices会被当作数组.
原文地址:https://www.cnblogs.com/itcomputer/p/4702781.html