Hi,
when unsetting items of an array, is it possible to update the index
numbers?
Code:
#!/bin/bash
set -x
array_length="address@hidden"
testarray=(
"a"
"b"
"c"
)
array_length="address@hidden"
true "${testarray[0]}"
unset testarray[0]
array_length="address@hidden"
true "${testarray[0]}"
Result:
+ array_length=0
+ testarray=("a" "b" "c")
+ array_length=3
+ true a
+ unset 'testarray[0]'
+ array_length=2
+ true ''
Expected result, last line:
+ true b
Cheers,
adrelanos