From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24008 invoked from network); 23 Apr 2021 23:02:16 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Apr 2021 23:02:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:Reply-To:Cc: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=r5DUyw52sGUxyfB42JJT4ES4wiUHOQl/X+T8LHewSg8=; b=qjl0wc0+EUWVJ6NZ/Eby1uoN4F RJxqmzwH7VhBwudbkw3vOx2FpsgU7VlEx9oJtAri8h5aXTfFoJXZ8Kchas4iIMDYGUQkqqe6fDI4j LonWkIeZcxhr/rKm/DD8bZ7TVdZ/MhoI+OUC24oomKXAHgiPUBC4ttPys4YQ+3AvSPUtbdCNhgJJX vTd/u6TXG2m70K52kzHOSoLPDYFPi0lcgIDs/F16+uWxWgpW29tRHB1yKRps532podh0XTUIWM7o1 Oh6m/ZLVl6TSdgqYNdxiBv22LBY3gVkIcFHyEqevEdmCIVS8ldPA1MPUS9uNJ9IKpzZBp8OMvuGoX vqsA7r2w==; Received: from authenticated user by zero.zsh.org with local id 1la4oO-000KkG-V9; Fri, 23 Apr 2021 23:02:13 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1la4oB-000KUu-J2; Fri, 23 Apr 2021 23:01:59 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.94) (envelope-from ) id 1la4oB-000EQn-5S for zsh-workers@zsh.org; Sat, 24 Apr 2021 01:01:59 +0200 In-reply-to: <20210423165326.GB2033191@zira.vinc17.org> From: Oliver Kiddle References: <7FD930F4-37CD-402B-9A06-893818856199@dana.is> <20210411175726.hxnm33mxoska2tsm@chazelas.org> <20210411194205.e7mr2wx33wlkq3rs@chazelas.org> <20210422135934.GA154089@zira.vinc17.org> <20210423165326.GB2033191@zira.vinc17.org> To: zsh-workers@zsh.org Subject: Re: sh emulation POSIX non-conformances (printf %10s and bytes vs character) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <55475.1619218919.1@hydra> Date: Sat, 24 Apr 2021 01:01:59 +0200 Message-ID: <55476-1619218919.166096@6bqh.WmTW.CAzf> X-Seq: 48682 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: 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. Oliver