im currently updating my first script i wrote to print room schedules I want to use getopts to parse my options now my question:
My Options are to print the schdule for all rooms are:
-w for the next day
-e to print the schedule for monday on friday
-c current day
-O with an given offset
So far so good.
No i want to print only one room with following options:
- -rw
- -re
- -rc
- -rO
How can i manage that with getopts? Something like that?
while getopts :a:b:c:d:hP: ARG; do
case $ARG in
ab) #set option "a"
echo "-a used: $OPTARG"
echo "OPT_A = $OPT_A"
;;
cd) #set option "b"
echo "-b used: $OPTARG"
echo "OPT_B = $OPT_B"
;;
Is that possible? I hope you understand what i mean...