$ array=( zero one two )
$ array+=( three four five )
$ declare -p array
declare -a array='([0]="zero" [1]="one" [2]="two" [3]="three"
[4]="four" [5]="five")'
$ array=( [0]=zero [1]=one [2]=two )
$ array+=( [3]=three [4]=four [5]=five )
$ declare -p array
declare -a array='([0]="zero" [1]="one" [2]="two" [3]="three"
[4]="four" [5]="five")'
$ declare -A assoc_array=( [zero]='0' [one]='1' [two]='2' )
$ assoc_array+=( [three]='3' [four]='4' [five]='5' )
$ declare -p assoc_array
declare -A assoc_array='([four]="4" [one]="1" [five]="5" [zero]="0"
[two]="2" [three]="3" )'

Talking about the lines with "+=", obviously. I only learned I could
do this when I found it in existing code.

Regards,
Zack

Reply via email to