On 27/10/2022 21:46, Bernhard Voelker wrote:
On 10/27/22 16:41, Pádraig Brady wrote:
Previously this was restricted to the C standard subset
which restricted most values <= 0x9F, as that simplifies the C lexer.
However printf(1) doesn't need this restriction.
Note also the bash builtin printf already supports all values <= 0x9F.

Nice one.

BTW: do we also want to support the new modifier that bash has since version 
5.2?

    r. The `printf' builtin has a new format specifier: %Q. This acts like %q 
but
      applies any specified precision to the original unquoted argument, then
      quotes and outputs the result.

That does sound useful.
However we yet don't support qualifiers on %q
which would need to come first.

  $ printf '%.4q\n' 'sp ace'  # builtin
  sp\

  $ env printf '%.4q\n' 'sp ace'
  printf: %.4q: invalid conversion specification

cheers,
Pádraig

Reply via email to