What I am trying to do is that if two specific arguments are passed at once then script would exit and HELP function is executed.
while getopts ":H:D:S:h:" arg; do
case "${arg}" in
H) HOUR=${OPTARG};;
D) DAY=${OPTARG};;
h) HELP;;
\?) #unrecognized option - show help
HELP;;
So that script if both H and D are presented I would like to terminate the script running and ask user to type it again.
Obviously I could use something like:
if [[ -z "$HOUR" || -z "$DAY" ]]
then
HELP
But was wondering if there are better options to do something like that. Cheers!