#!/bin/sh
if test $# -eq 0
then
echo Must provide parameters.
exit 1
fi
while test ! $1 = "end"
do
echo parameter is $1
shift
if test $# -eq 0
then
echo Parameter list MUST contain the '"'end'"' string.
exit
fi
done
echo Done: I"'"ve hit the '"'end'"' string.
exit 0
Note that the above example could have been MUCH shorter if no error
checking took place.
The length of strings can also be tested using: