I didnt test this at all, just a thought I had. Im sure there are a million ways to do this.
Code:
USAGE="Usage: `basename $0` [-s schemaname] [-d databasename] [-u username] -f -t -h"
while getopts :s:d:u:fth params
do
case $params in
s) SOURCESCHEMA="$OPTARG"
let COUNT= $COUNT+10000
;;
f) FULL='y'
;;
t) TABLE='y'
;;
d) DBNAME="$OPTARG"
let COUNT= $COUNT+1
;;
u) USERNAME="$OPTARG"
let COUNT= $COUNT+1000
;;
h)
help_doc
exit 0
;;
?)
echo "Invalid Option Specified"
echo "$USAGE" 1>&2 ; exit 1
;;
esac
if [ "$COUNT" -ne 10101 ]
then
help_doc
exit 0
elif [ ! -z $FULL ]
then
echo "Paramater FULL is Set"
elif [ ! -z $TABLE ]
then
echo "Paramater TABLE is Set"
else
echo "Neither TABLE or FULL Are Set"
fi