Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: sh emulation POSIX non-conformances (printf %10s and bytes vs character)

Vincent Lefevre wrote:
> On 2021-04-22 12:22:12 -0700, Bart Schaefer wrote:
> > Someone can probably point to the rationale document, but I'm guessing
> > this is really because of equivalence with sprintf() formats.
> Some file formats have fields with a byte-size limit. Providing
> more than this limit could have unexpected effects. One may also
> want to limit the size of generated filenames (see NAME_MAX).

And for every one time that someone needs something like that, there
are a zillion cases where people just want to line up output neatly in
columns and are thwarted. More likely, this was just standards people
insisting on exactly matching the C printf().

A high level language like a shell should not force users to know about
low-level character encodings. Python 3 gets this fairly badly wrong.
I'd prefer that we make it useful first and if the POSIX committee
decree some crazyness, we have the emulation facility.


Messages sorted by: Reverse Date, Date, Thread, Author