9.9.4 while
do
command list
[break]
[continue]
done
A simple script to illustrate a while loop is:
#!/bin/sh
while [ $# -gt 0 ]
do
echo $1
shift
done
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
one
two
three