The case statement in the bash script does not work. Below is the snippet of my shell script.
usage="Usage: \n servicer [ service argument ] {-h}\n"
invalid="\n not a valid option\n"
argument="\n Please use -h option for help\n"
while getopts ":h:s" option
do
case "${option}" in
s ) service=$OPTARG;;
h ) echo -e $usage
exit 0
;;
* ) echo -e $invalid
exit 1
;;
esac
done
So whenever i run my script with -h or -s option the flow goes to the last * option.