in reply to How to use getopts?

Am I on the right track?
No. You failed to heed much of the advice already given to you in your previous related question: How to use getopts to look in a file and submit each item in the file to a job with different switches.