I have script where i need to display usage command in case user miss any mandatory information while executing script.
Usage : Script -s <server> -i <instance> -u <user> -p <password> <query> -w <warning value> -c <critical value>
With explanation about all the OPTIONS
I'm getting values from arguments as below variables fashion. But I want this usage with validations in shell script.
SERVER=$1
INSTANCE=$2
USER=$3
DB_PASSWD=$4
QUERY=$5
VAL_WARN=$6
VAL_CRIT=$7
I have tried using getopts, But failed to use since <query>
doesn't have a -q
parameter before passing the value.
I have tried finding all other ways, But everyone suggested getopts which is not feasible solution for me.
Please help me on this..