So I want to pass a for loop in my bash script, and I want it to stop depending on two parameters:
for (( x=1; x<= 50 -a $array_position -lt ${#array[@]}; x++ ))
do
echo ${array[$array_position]}
array_position=$((array_position+1))
done
My intention is to have this for loop echo 50 consecutive array values [0] -- [50], but stop if $array_position reaches the end of the array before all 50 loop iterations complete.
Any help is appreciated, as always!