轉載自http://stackoverflow.com/questions/19417015/bash-copy-from-one-array-to-another
a=(foo bar "foo 1" "bar two") #create an array b=("${a[@]}") #copy the array in another one for value in "${b[@]}" ; do #print the new array echo "$value" done
===================================
copy=( "${array[@]}" )