您的位置:首页 > 运维架构

copy from one array to another

2015-06-30 14:00 447 查看
轉載自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[@]}" )


 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: