Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15203

Re: Incorrect option processing in builtin printf(1)

From Stephane Chazelas <stephane.chazelas@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: Incorrect option processing in builtin printf(1)
Date 2019-07-22 21:10 +0100
Message-ID <mailman.2026.1563826262.2688.bug-bash@gnu.org> (permalink)
References <201907221756.x6MHuxaR019063@jinx.noi.kre.to> <mailman.2014.1563818289.2688.bug-bash@gnu.org> <20190722194843.azebfqpardb76fdd@chaz.gmail.com> <c5f167d3-c0bd-dccd-a7a2-125a1bd3385d@redhat.com> <20190722201054.pintfyjl3fqq66wx@chaz.gmail.com>

Show all headers | View raw


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

Back to gnu.bash.bug | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Incorrect option processing in builtin printf(1) kre@munnari.OZ.AU - 2019-07-23 00:56 +0700
  Re: Incorrect option processing in builtin printf(1) Stephane Chazelas <stephane.chazelas@gmail.com> - 2019-07-22 20:48 +0100
  Re: Incorrect option processing in builtin printf(1) Eric Blake <eblake@redhat.com> - 2019-07-22 14:55 -0500
  Re: Incorrect option processing in builtin printf(1) Stephane Chazelas <stephane.chazelas@gmail.com> - 2019-07-22 21:10 +0100

csiph-web