Welcome to LinuxQuestions.
Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.
By using a for loop (have you learned about loops yet) as suggested you can iterate through the list using a single if then else statement. well there are several ways to write your assignment. getopts is overkill. Don't want to confuse the OP...
I will also add that the shift command as posted will move the i.e shift the arguments to the left by 1. So $2 will be $1. You need to check $1 vs $@. You can use $@ in the loop.
Last edited by michaelk; 03-23-2015 at 09:13 AM.