For simple cases you can also use shift
.
It treats the argument list like a queue. Each shift
throws the first argument out and the
index of each of the remaining arguments is decremented.
#this prints all arguments
while test $# -gt 0
do
echo "$1"
shift
done