2019-07-22 14:55:05 -0500, Eric Blake: [...] > > Even if POSIX didn't mandate > > > > printf -- -%s x > > > > to output -x, I'd say it would be a bug in the POSIX > > specification (it looks like it is). > > POSIX _does_ mandate 'printf -- -%s x' to output exactly '-x', by virtue > of the fact that it mandates all utilities (other than special builtins) > with the specification 'OPTIONS None.' to parse and ignore '--' as the > end of options, whether or not the utility takes options as an > extension. If NetBSD broke that behavior, that is a bug in NetBSD's > shell, not bash nor POSIX. [...]
Yes, thanks for pointing to the right section. I wish POSIX made it clearer. Having it spread like that in different sections with no full linking within them is suboptimal. The special treatment of special builtins seems bogus to me as well (like the fact that it seems it makes : "$x" unspecified unless $x can be guaranteed not to start with -; the description of the colon utility with its "expands its arguments" is bogus anyway). -- Stephane