On Fri, Apr 30, 2021 at 12:03:00PM +0100, Raf Czlonka wrote: > Hi Mark, > > You and me both ;^) > > Until recently, I thought that getopt(1) was POSIX, whereas it is > in fact getopts(1), and it is not a shell built-in there, but a > utility[0].
Nope, it is a shell built-in... the "wording" of posix is a bit strange, but you can't possibly set variables inside the shell from an outside command. It has the same status as read. and I haven't looked too closely, but I would assume most of the BUG in getopt(1) do not apply to getopts