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 14507 invoked from network); 12 Mar 2020 00:53:40 -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; 12 Mar 2020 00:53:40 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id A8F029BC0D; Thu, 12 Mar 2020 10:53:36 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 6ECAD9BB47; Thu, 12 Mar 2020 10:53:19 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 5AF539BB47; Thu, 12 Mar 2020 10:53:18 +1000 (AEST) Received: from frieza.hoshinet.org (ks3374089.kimsufi.com [37.187.103.66]) by minnie.tuhs.org (Postfix) with ESMTP id 7460F9BB46 for ; Thu, 12 Mar 2020 10:53:15 +1000 (AEST) Received: by frieza.hoshinet.org (Postfix, from userid 1005) id C0F271C8C79B; Wed, 11 Mar 2020 20:53:13 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by frieza.hoshinet.org (Postfix) with ESMTP id 61C8D1C8C798; Wed, 11 Mar 2020 20:53:13 -0400 (EDT) Date: Wed, 11 Mar 2020 20:53:12 -0400 (EDT) From: Steve Nickolas X-X-Sender: nicci@frieza.hoshinet.org To: Greg 'groggy' Lehey In-Reply-To: <20200311225638.GG89512@eureka.lemis.com> Message-ID: References: <202003031815.023IFSlD493028@darkstar.fourwinds.com> <20200311225638.GG89512@eureka.lemis.com> User-Agent: Alpine 2.02 (BSF 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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" On Thu, 12 Mar 2020, Greg 'groggy' Lehey wrote: > On Wednesday, 11 March 2020 at 14:18:08 +1100, Dave Horsfall wrote: >> >> The "ls" command for example really needs an option-ectomy; I find that I >> don't really care about the exact number of bytes there are in a file as >> the nearest KiB or MiB (or even GiB) is usually good enough, so I'd be >> happy if "-h" was the default with some way to turn it off (yes, I know >> that it's occasionally useful to add them all up in a column, but that >> won't tell you how many media blocks are required). > > 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 > > But that's a pain, isn't it? That's why there's a -h option for > people who like it. Note that you can't do it the other way round: > you can't get the exact size from -h output. > > 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. > >> Quickly now, without looking: which option shows unprintable >> characters in a filename? Unless you use it regularly (in which >> case you have real problems) you would have to look it up; I find >> that "ls ... | od -bc" to be quicker, especially on filenames with >> trailing blanks etc (which "-B" won't show). > > This is arguably a bug in the -B option. I certainly don't think the > pipe notation is quicker. But it's nice to have both alternatives. > > 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 > I went through all the switches defined by POSIX, and figured that those 26 could be cut down. My concept reduced the number of switches from 26 to 9 (FLRadfiln). Of course, the idea is to be more minimalist than POSIX, so some people's opinions on what is or isn't necessary may differ from mine. Of course, this changes the default behavior of ls because it no longer would be able to do columnar listings (|column for that). I felt -A was a redundant "almost -a". I felt -C and -x were redundant because a tool like column(1) could be used to do the same job (even though column(1) isn't POSIX). I felt -H was a redundant "almost -L". I felt -S, -r and -t could be implemented in other ways using sort(1). I felt -c and -u were meaningless, but that's because of the filesystems I usually work with that do not have functional equivalents. -u for one is completely useless on VFAT even though it has such timestamps! YMMV. I felt -g and -o could be replaced by cut(1). I felt -k wasn't really all that important. Just halve the numbers. I felt -m wasn't really all that important. There's other ways to convert to that format, no doubt, through filters. I felt -p was a redundant "almost -F". I felt -q could be done just fine with something like tr(1). I felt -s was a redundant "kindasorta -l". And -1 becomes the new default, so it's redundant. ;) Again, YMMV. ;) -uso.