How to Use getopts to Parse Linux Shell Script Options
Do you wish your Linux shell scripts would handle command-line options and arguments more gracefully? The Bash getopts builtin lets you parse command-line options with finesse—and it’s easy too. We show you how.
Source: howtogeek.com