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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18116 invoked from network); 24 Apr 2021 21:46:38 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Apr 2021 21:46:38 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1619300798; b=RCVTegz2iHLT5K+JwhfH4qvQWrAD2fBL1+rN9v7OAYi5Ql6gzez9QXVogiUE1N6dcba2C5JpRW FZJ640ZirKuMclLmS0Gr7G+NM8IudI+ncPzrxuHBZ0dzrUrTGNhGzJHBZWAtz96off6BWStcZs x2MYJFNh84ewiPZ7gq9X5CxWJYkLrZVLC8sDrdtpnE6pf2z4D3xL1A7p+LEqyeNbEtU++PtA07 xLkG0AlO1i8XC96p3gu1mNv8bCCcRaT/07b8Zd1/Mq9swfFoaZ/rmoIJf2C039Subl5fUmABcK b+rIIsOTpQVSQHUnDOiK0xeqTfHkWIfd3h69ncbUi3lyxg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1619300798; bh=fSkOmU6SZisFTZ9e0/dZFiQkiLAQojhom06ZV1fngIs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature; b=k+d9XLSa6ahz2gKYB8gk21ABl69WhU41KQynn2iFUJ1kVNs6IY/qqVAqZYVvfDu4A1+9hT7ePO 4BF+gQypk8HvrzGeiQqx9Mlqyhv3cym+vuPE7e4hh2rYNIeAH79yBBl2CHIUC+7Jf10/CD5/Rg bPRuY4bjwfGEGJtSa8xk/VGgHVn6T358hJOJdh+3JYM1ppc+V2+izoN8LwsSKkiWspE3VlurXy bjAeqx8PMQWjuROpDlAkogfIejduL/mH8ZAn+IpKeOlpYZy6LT7a5zGNrddHSBfAib7zcc4rqX 05+RUkE4QhliaY5tDPjuKCGGvgL2LsgQLBRmWLn0YjsL6w==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=uiDFjl7xPZgFBWDrpB7A5xx8pEsI9AR6e6tC5vJ60Ug=; b=PDeL7eRUSC3jPc3CIJe2lFbuAv t66q1Yw+DIHiBxrRM5SXn3JEzee+UO0AvqVL869KM5rlHLy7u0aTE2TmaADc4MkAaGTFHl61GEUMY a9CdyXV4OusApf3owwi1BgyLUf9m23F0KQnfI61AvlIYQwgrVGTSAKcYuw3zFq9Irc+92v1pj8s9C ht0LvXTtQWRFGPfmBmf68oWqLwh4N1GjRXNeNnziPAVZqrfWEZ2r6Q1y5c/rLckBYR3kg7NaXCZaZ JJsVGzTQL6du+nyiExrqtHvvWpNSfTIAZitwwOo3fPxeYpZjJJhrSnZ9igX4a+dOnE3RGfFrCrr0B ypkGHdPg==; Received: from authenticated user by zero.zsh.org with local id 1laQ6m-00077I-It; Sat, 24 Apr 2021 21:46:36 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:53722) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1laQ6W-0006rK-Q9; Sat, 24 Apr 2021 21:46:21 +0000 Received: from smtp-zira.vinc17.net (unknown [IPv6:2a01:cb19:869c:7700:6150:861a:e24c:595d]) by joooj.vinc17.net (Postfix) with ESMTPSA id 76AAF100; Sat, 24 Apr 2021 23:46:20 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 99AFDC22871; Sat, 24 Apr 2021 23:46:18 +0200 (CEST) Date: Sat, 24 Apr 2021 23:46:18 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: sh emulation POSIX non-conformances (printf %10s and bytes vs character) Message-ID: <20210424214618.GB2587578@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org 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> <55476-1619218919.166096@6bqh.WmTW.CAzf> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <55476-1619218919.166096@6bqh.WmTW.CAzf> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.0.6+160 (30e657d3) vl-137001 (2021-04-24) X-Seq: 48692 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: On 2021-04-24 01:01:59 +0200, Oliver Kiddle wrote: > 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(). And even for that, this is currently buggy (at least under Debian) with double-width characters. Try: printf "|%3s|\n" a 🍸 -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)