Bash manual says
getopts optstring name [args]When the end of options is encountered,
getoptsexits with a return value greater than zero.OPTINDis set to the index of the first non-option argument andnameis set to?.
Does it mean that
- getoptsonly read in options and option arguments, but not arguments which are neither options nor option arguments?
- getoptscan't work with the case where in the command line, some options are specified after some arguments which are neither options nor option arguments? In other words, does- getoptsrequire that arguments which are neither options nor option arguments be specified after all the options and option arguments?
Thanks.

