3.6.5. getopt - parse option arguments

3.6.5.1. Usage

getopt OPTSTRING VAR

3.6.5.2. Synopsis

OPTSTRING contains the option letters. Add a colon to an options if this option has a required argument or two colons for an optional argument. The current option is saved in VAR, arguments are saved in $OPTARG. Any non-option arguments can be accessed starting from $1.