Some shells automatically resets the OPTIND
variable used getopts
when entering a function, some not.
For instance GNU bash 3.2.57(1) does not reset the OPTIND
variable when it enters a function while zsh 5.0.5 does.
Which shells automatically resets OPTIND
when entering a function? What is the behaviour recommended by POSIX?