A simple script to illustrate a while loop is:
while [ $# -gt 0 ]
This script takes the list of arguments, echoes the first one, then shifts the list to the left, losing the original first entry. It loops through until it has shifted all the arguments off the argument list.
$ ./while.sh one two three