#!/bin/bash
#
# The 'break' builtin exits the current loop.
# You can specify a parameter (break n) to exit the n-th enclosed loop.
#
# Example

for (( i=0 ; i<10 ; i++ ))
do
    echo "iteration: $i"
    if [ "$i" -eq 5 ]; then
        echo "Breaking the loop at 5. Bye!"
        break
    fi
done

# The 'continue' builtin resumes the next iteration of the current loop.
# You can specify a paramter (continue n) to continue the n-th enclosed
# loop.
#
# Example

for i in {1..10}
do
     if (( i % 2 == 0 )); then
        # Skip even numbers
        continue
    fi
    echo "Odd number: $i"
done

