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)

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Stephane Chazelas <stephane.chazelas@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: Incorrect option processing in builtin printf(1)
Date Mon, 22 Jul 2019 21:10:54 +0100
Lines 28
Approved bug-bash@gnu.org
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>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1563826263 10401 209.51.188.17 (22 Jul 2019 20:11:03 GMT)
X-Complaints-To action@cs.stanford.edu
Cc kre@munnari.OZ.AU, bug-bash@gnu.org
To Eric Blake <eblake@redhat.com>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DxyOXYZ9ukN1WwECIqsrPYA7yELSUO/mGuhLdNz7ID0=; b=MLVJMcnRVzF8raMj82+I/RzZlpm4Nml1eZAUwWWbIS8lvr2MtMPqHcrr745UuGZxOA tRO97c5DfGveIaA+ydOXW1wPIuDuuPJFcn7/BAaEDGz/E2ue3gsGg5+BK3234ttmINPr uL82OfVbWwZH52xxnPK2u7KsMYo45mPoaIa7gTN+QgGqpiyC3nr1kUfrmP9voyS8JJD9 TAs7MaDGH3ErLqle54WdTpD1x5N45V/H40vX96ZpSfmxZJFmpc2VEKq3rHO+gUAYmkfe Tfh+8af6O+r7qNxM+6jnLuA90Db+KJJzYllwub14PgXgojjo8LwQJjZv3VBFEOEVdKzE ALEQ==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=DxyOXYZ9ukN1WwECIqsrPYA7yELSUO/mGuhLdNz7ID0=; b=nuvICtiuCDk+O8xYBnlUsoS77K6IupqaAQvkbhQ4p3INW/gGdiJCKUAU1bTUeTulxx LsfyKbOHg1NxfRPDXzDeBrPDpuDKq4wtjB65ksS/TwlJAk7Ur0+nRdeSjNvvE6G7XzEw ETAg2cmQYWZ4MFQwdcTgcTfJEBv5j4ktuHz3n2wWuKp3Z5fNrs97RhuIJmGCZkYvJ0E/ oiZqwbfKeF3BW6+Bx+wNgUi4DO1ut9kDpiQmzR7z8bIlJVb17d4USGrnq+I9gy1j2VXB 7eVhucRIyw+9HP7TzStjoA9ZQg+Yi+I650ObOo2Yn3UaZsb+BHDNYUmSEB5tB5sDVv5R hb3Q==
X-Gm-Message-State APjAAAW8yTPQ8Bb8rFXP3A1sD0KwV+B20+eFiyupVtrlZYAI6SxD1PTb dUs2aGrnUOFCEisSL6jrUzY=
X-Google-Smtp-Source APXvYqzViWxycKoKmtxVfbSlt3f3bCTCW1+qw9C6tb8BcIVgqbhxicBJv1r/uK6HkZEN17Wid5AhZA==
X-Received by 2002:a05:6000:4b:: with SMTP id k11mr73593350wrx.82.1563826256701; Mon, 22 Jul 2019 13:10:56 -0700 (PDT)
Content-Disposition inline
In-Reply-To <c5f167d3-c0bd-dccd-a7a2-125a1bd3385d@redhat.com>
User-Agent NeoMutt/20171215
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2a00:1450:4864:20::42b
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <20190722201054.pintfyjl3fqq66wx@chaz.gmail.com>
X-Mailman-Original-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>
Xref csiph.com gnu.bash.bug:15203

Show key headers only | 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