copy from one array to another

来源:互联网 发布:minecraft mac版 编辑:程序博客网 时间:2024/04/30 06:34
轉載自http://stackoverflow.com/questions/19417015/bash-copy-from-one-array-to-another

复制代码
a=(foo bar "foo 1" "bar two")  #create an arrayb=("${a[@]}")                  #copy the array in another one for value in "${b[@]}" ; do    #print the new array echo "$value" done
复制代码
 

 ===================================

copy=( "${array[@]}" )

 

0 0
原创粉丝点击