From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,RDNS_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 Received: (qmail 24016 invoked from network); 13 Mar 2020 00:37:28 -0000 Received-SPF: pass (minnie.tuhs.org: domain of minnie.tuhs.org designates 45.79.103.53 as permitted sender) receiver=inbox.vuxu.org; client-ip=45.79.103.53 envelope-from= Received: from unknown (HELO minnie.tuhs.org) (45.79.103.53) by inbox.vuxu.org with ESMTP; 13 Mar 2020 00:37:28 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id E5B2A9CD85; Fri, 13 Mar 2020 10:37:24 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id AEB249CD60; Fri, 13 Mar 2020 10:36:55 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id E0FC29CD60; Fri, 13 Mar 2020 10:36:50 +1000 (AEST) Received: from lax.lemis.com (www.lemis.com [45.32.70.18]) by minnie.tuhs.org (Postfix) with ESMTP id F0F3A9CD5F for ; Fri, 13 Mar 2020 10:36:49 +1000 (AEST) Received: from eureka.lemis.com (aussie-gw.lemis.com [167.179.139.35]) by lax.lemis.com (Postfix) with ESMTP id 2E304280B8; Fri, 13 Mar 2020 00:36:48 +0000 (UTC) Received: by eureka.lemis.com (Postfix, from userid 1004) id 841EF263595; Fri, 13 Mar 2020 11:36:47 +1100 (AEDT) Date: Fri, 13 Mar 2020 11:36:47 +1100 From: Greg 'groggy' Lehey To: Dave Horsfall Message-ID: <20200313003647.GM89512@eureka.lemis.com> References: <202003031815.023IFSlD493028@darkstar.fourwinds.com> <20200311225638.GG89512@eureka.lemis.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cy9Nn4fUvYST66Pl" Content-Disposition: inline In-Reply-To: Organization: LEMIS, 29 Stones Road, Dereel, VIC, Australia Phone: +61-3-5309-0418 Mobile: +61-490-494-038. Use only as instructed. WWW-Home-Page: http://www.lemis.com/grog X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 User-Agent: Mutt/1.6.1 (2016-04-27) Subject: Re: [TUHS] Command line options and complexity X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --cy9Nn4fUvYST66Pl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thursday, 12 March 2020 at 16:22:01 +1100, Dave Horsfall wrote: > On Thu, 12 Mar 2020, Greg 'groggy' Lehey wrote: > >> A good example. But you're not removing options, you're just redefining >> them. In fact I find the -h option particularly emetic, so a better >> choice in removing options would be to remove -h and use a filter to >> mutilate the sizes: >> >> $ ls -l | humanize > > I also had something like that in mind, except being British/Australian > I'd spell it with an "s" :-) It's a common misconception that -ize is US English. The Oxford English Dictionary, normally not prescriptive, prefers it. See https://www.oed.com/page/faqs/Frequently+asked+questions#spell. I personally had -ise drummed out of me by my uncle, very much Australian. >> And then there's the question why you don't like the standard output. >> Because the number strings are too long and difficult to read, maybe? >> That's the rationale for the -, option. > > More than likely; as I approach age 68 I notice that I'm losing some > cognitive facility... I might start using "," and see if I like it, but I > see that the Mac doesn't have it (my Penguin is off the air at the > moment), and having it as an environment variable would be nice. Yes, currently only FreeBSD has it. But you have the sources. Apart =66rom option handling, it's only: --- print.c (.../head/bin/ls/print.c) (revision 241014) +++ print.c (.../stable/10/bin/ls/print.c) (working copy) @@ -606,6 +606,10 @@ humanize_number(buf, sizeof(buf), (int64_t)bytes, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); (void)printf("%*s ", (u_int)width, buf); + } else if (f_thousands) { /* with commas */ + /* This format assignment needed to work round gcc bug. */ + const char *format =3D "%*j'd "; + (void)printf(format, (u_int)width, bytes); } else (void)printf("%*jd ", (u_int)width, bytes); } A quick and dirty fix would be simply to replace the format string. Greg -- Sent from my desktop computer. Finger grog@lemis.com for PGP public key. See complete headers for address and phone numbers. This message is digitally signed. If your Microsoft mail program reports problems, please read http://lemis.com/broken-MUA --cy9Nn4fUvYST66Pl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAl5q1Z8ACgkQIubykFB6QiNrkQCggXAmm8cQixpb3AFDFWpF/xf7 7I4AnRjNp29EACedSFHSg7h+6sUdGldW =xYGo -----END PGP SIGNATURE----- --cy9Nn4fUvYST66Pl--