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 14495 invoked from network); 14 Mar 2020 20:26:14 -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; 14 Mar 2020 20:26:14 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 3081C9CD8C; Sun, 15 Mar 2020 06:26:12 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 2EDC39CD60; Sun, 15 Mar 2020 06:25:54 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id AD2BC9CD60; Sun, 15 Mar 2020 06:25:52 +1000 (AEST) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) by minnie.tuhs.org (Postfix) with ESMTPS id 006799CD5F for ; Sun, 15 Mar 2020 06:25:51 +1000 (AEST) Received: by sdaoden.eu (Postfix, from userid 1000) id B30A116054; Sat, 14 Mar 2020 21:25:49 +0100 (CET) Date: Sat, 14 Mar 2020 21:25:49 +0100 From: Steffen Nurpmeso To: "John P. Linderman" Message-ID: <20200314202549.I-Zpc%steffen@sdaoden.eu> In-Reply-To: References: <20200314043505.GD44529@eureka.lemis.com> Mail-Followup-To: "John P. Linderman" , "Greg 'groggy' Lehey" , The Eunuchs Hysterical Society User-Agent: s-nail v14.9.17-52-g56288e6a OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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" John P. Linderman wrote in : |Here's a command I wrote long ago using a different way to deal with \ |options: | |=C2=A0 isee |Usage: isee format file ... |=C2=A0 =C2=A0 Display specified inode information for files passed as arg= uments. |=C2=A0 =C2=A0 Items of the form ``%X'' in format will be replaced for the= se X: |dev inode ino mode nlink uid gid rdev size atime |mtime ctime now filename |=C2=A0 =C2=A0 Parenthesized printf-style format specifications can follow= a % |=C2=A0 =C2=A0 to override the default format for the various items. |=C2=A0 =C2=A0 %filename is the name of the current file argument. |=C2=A0 =C2=A0 %now is the time (in seconds) when the command started runn= ing. |=C2=A0 =C2=A0 The other items are from the stat structure. | |=C2=A0 =C2=A0 Example: isee "%(40s)filename: %mtime %mode" /dev/null |=C2=A0 =C2=A0 Show file modification time and mode of /dev/null | |inode is just a synonym for ino. | |Instead of a kazillion options, the %-stat-field items identify what \ |you want to see and the printf-style formats identify how you want \ |them shown. Someone in the Murray Hill library added strftime=20 |formats for date fields, a fine addition, in my view. Adding readable \ |user and group names rather than numerical ids would be worth considering= . \ |Maybe having a "rwx"-style form for mode. Sorting can be=20 |done by piping the output through sort. Don't get hung up on shortcomings= \ |of the command, just consider how a few familiar concepts and pipes \ |can be combined to provide a large number of options. When i switched to FreeBSD around 2001, the handbook was on the CDs i had, and i stumbled upon a very impressive assembler example. It is still there[1], at least in parts(?). Coming from C64, then DOS/4DOS and <2 years Linux, aka kid games, grey-industry, MS and xeyes background, i read [1] https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook= /x86-fpu.html Personally, I like to keep it simple. Something either is a number, so I process it. Or it is not a number, so I discard it. I do not like the computer complaining about me typing in an extra character when it is obvious that it is an extra character. Duh! Plus, it allows me to break up the monotony of computing and type in a query instead of just a number: What is the best pinhole diameter for the focal length of 150? There is no reason for the computer to spit out a number of complaints: Syntax error: What Syntax error: is Syntax error: the Syntax error: best Et cetera, et cetera, et cetera. Secondly, I like the # character to denote the start of a comment which extends to the end of the line. This does not take too much effort to code, and lets me treat input files for my software as executable scripts. and it was like being warped from Chaplin's Modern Times to a rich man's California style living! And that in assembler!! % pinhole Computer, What size pinhole do I need for the focal length of 150? 150 490 306 362 2930 12 Hmmm... How about 160? 160 506 316 362 3125 12 Let's make it 155, please. 155 498 311 362 3027 12 Ah, let's try 157... 157 501 313 362 3066 12 156? 156 500 312 362 3047 12 That's it! Perfect! Thank you very much! ^D Nonetheless: i never managed to create Hippie-proof programs in real life. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)