I have an indexed bash array and I’d like to use an expression like “${a[@]}” except I want it to not include a[0]. The best that I can think of is this:
j=0
for i in "${a[@]}"
do
b[j]=${a[++j]}
done
and then use “${b[@]}”. Is there a better way?
1 Answer