Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] getopts OPTIND



On 9 Jan 2018, at 16:57, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>There's a whole thread from 2015 related to this, beginning with workers/35317

Oops, sure enough. Sorry.

Well, i'm not sure about POSIX correctness, but for whatever it's worth, i can
confirm that all of the following are in agreement as to how it should behave:

ash (BusyBox)
bash
dash
ksh93
mksh
posh

The ksh that comes with OpenBSD (derived from pdksh i think) seems to stop
updating OPTIND after it encounters an invalid option until it finds either a
legal one or the end of the argument list; after that it's set back to the
correct value.

yash just seems broken somehow, it gives me nonsense.

dana



Messages sorted by: Reverse Date, Date, Thread, Author