See getopts. The synopsis shows how to differentiate between an option that does not take an argument and one that takes an argument.
You most likely want n: as option instead of n.
In reply to Re: Issue with getopts : Not getting the value as passed on command line
by Corion
in thread Issue with getopts : Not getting the value as passed on command line
by rahulme81
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |