Need explanation for the syntax

Hi it will be very useful for me if anyone gives step by step explanation for the below code:

USAGE="check -S dbserver [-D dbname] [-U userid]
where
-S dbserver specifies name of database server
-D dbname specifies name of database on database server
-U userid specifies name of user for database"

while getopts ":S:D:U:" OPTION "$@"
do
case $OPTION in
S) SRVR=$OPTARG;;
D) DB="$OPTARG"; USEDB="use $OPTARG";;
U) UID=$OPTARG;;
:slight_smile: MISSINGOPTARG="$MISSINGOPTARG -$OPTARG";;
?) if [ "$OPTARG" = "?" ]
then
HELP=1
else
UNEXPECTEDOPT="$UNEXPECTEDOPT -$OPTARG";
fi;;
esac
done

In Korn shell,
Assuming your script is test.ksh, Run this as

or Add

in the script and try