numbers=(2 3 5 7 11 13 17 19)
s=""
#"${!numbers[@]}" are the indexes;
#${s:+-} gives "-" only if s is not empty
for i in "${!numbers[@]}"; do
if (( i % 2 == 1 )); then
continue
fi
s+="${s:+-}${numbers[i]}"
done
#s is "2-5-11-17"
#continue 2 goes on with the next step of the outer loop
pairs=()
for a in 1 2 3; do
for b in 1 2 3; do
if (( b > a )); then
continue 2
fi
pairs+=("$a$b")
done
done
#pairs is (11 21 22 31 32 33)
echo "s is $s"
echo "pairs is (${pairs[*]})"