I'd like to build a Linux script with an argument in the format HH:MM.
An example invocation:
./my_script.sh 08:30
Within the script, I'd like to assign the hours and minutes to 2 vars, HRS
and MINS
.
So, for my example invocation HRS
would be assigned the value 8, and MINS
would be assigned the value 30.
I don't want an invocation format like:
./my_script.sh -hrs 08 -mins 30
How should I parse my input argument to get hours and minutes?