I want to write a script that loops through a array and loop will consider current and following values in every round, for example -
VARIABLES=( 10 20 30 40 50 80 )
for i in ${VARIABLES[@]}; do ## Ideally it should stop at 2nd last value
#Value1=$i
#Value2=$(i+1)
done
How to achieve the same in correct way?