【发布时间】:2019-07-07 13:12:54
【问题描述】:
我创建了两个数组:
第一个数组:
echo "${array1[@]}"
two
three
four
five
第二个数组:
echo "${array2[@]}"
apples
carrots
potatoes
tomatoes
我想将它们组合在一个循环中(或类似的东西),并保持第一个数组和第二个数组之间的关系。
two apples
three carrots
four potatoes
five tomatoes
谢谢。
【问题讨论】:
标签: arrays bash loops multidimensional-array indexing