bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] printf: add %#s alias to %b


From: Chet Ramey
Subject: Re: [PATCH] printf: add %#s alias to %b
Date: Fri, 1 Sep 2023 09:58:34 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0

On 8/31/23 5:15 PM, Eric Blake wrote:


It's not hard to see why POSIX is choosing to have Issue 8 obsoleting
(not removing) %b's old semantics; in the short term, nothing about %b
changes, so your dusty-deck shell scripts will continue to work as
they have before; but you now have enough time to update your scripts.

History has shown us that many will not.

The question is whether Issue 9 (several years down the road) will be
able to repurpose %b to mean binary literal output (only possible if
all shell authors agree that C2X compatibility is worth it),

Unlikely.


But if POSIX _is_ able to repurpose %b (because enough shell authors
agree that binary output is more useful these days than XSI echo
compatibility),

I think you'll find that, regardless of its origins, there are more scripts
using the %b specifier than you think.

the followon question is whether there should be a
portable way to access the old functionality.  Since %#s is currently
unspecified, we are trying to guage feedback of how many
implementations are willing to add that alias now, which in turn will
affect whether Issue 9 can mandate that behavior (because everyone
liked it) or must continue to leave it undefined.

But nothing is stopping coreutils from adding %#s as an extension now,
regardless of what input other shell authors provide to the ongoing
POSIX discussion.

I don't have a problem adding %#s. I have a problem with POSIX not seeing
that the printf builtin is not a direct parallel to the library function
and forcing an incompatible change.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]