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会被当作数组.
posted @ 2015-08-04 18:24  arun_yh  阅读(433)  评论(0)    收藏  举报