numbers=(2 3 5 7 11 13 17 19)
s=""
#${s:+-} gives "-" only if s is not empty
for number in "${numbers[@]}"; do
if (( number > 10 )); then
break
fi
s+="${s:+-}$number"
done
#s is "2-3-5-7"
#break 2 leaves two loops at once
found=""
for a in 1 2 3; do
for b in 1 2 3; do
if (( a * b == 6 )); then
found="$a*$b"
break 2
fi
done
done
#found is "2*3"
echo "s is $s"
echo "found is $found"