From: Steffen Nurpmeso <steffen@sdaoden.eu>
To: "John P. Linderman" <jpl.jpl@gmail.com>
Cc: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: Re: [TUHS] Command line options and complexity
Date: Sat, 14 Mar 2020 21:25:49 +0100 [thread overview]
Message-ID: <20200314202549.I-Zpc%steffen@sdaoden.eu> (raw)
In-Reply-To: <CAC0cEp-dL2iPikiGvaQ_s9_6AS=mFO4RvbT423fNJ3gQiLdthQ@mail.gmail.com>
John P. Linderman wrote in
<CAC0cEp-dL2iPikiGvaQ_s9_6AS=mFO4RvbT423fNJ3gQiLdthQ@mail.gmail.com>:
|Here's a command I wrote long ago using a different way to deal with \
|options:
|
| isee
|Usage: isee format file ...
| Display specified inode information for files passed as arguments.
| Items of the form ``%X'' in format will be replaced for these X:
|dev inode ino mode nlink uid gid rdev size atime
|mtime ctime now filename
| Parenthesized printf-style format specifications can follow a %
| to override the default format for the various items.
| %filename is the name of the current file argument.
| %now is the time (in seconds) when the command started running.
| The other items are from the stat structure.
|
| Example: isee "%(40s)filename: %mtime %mode" /dev/null
| 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
|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
|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)
next prev parent reply other threads:[~2020-03-14 20:26 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-13 10:45 Dave Horsfall
2020-03-14 4:35 ` Greg 'groggy' Lehey
2020-03-14 19:52 ` John P. Linderman
2020-03-14 20:25 ` Steffen Nurpmeso [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-03-10 18:42 Doug McIlroy
2020-03-10 19:38 ` Dan Cross
2020-03-10 16:15 Doug McIlroy
2020-03-10 17:38 ` Dan Cross
2020-03-10 17:44 ` Bakul Shah
2020-03-10 18:09 ` Dan Cross
2020-03-05 4:57 Doug McIlroy
2020-03-05 22:17 ` Diomidis Spinellis
2020-03-04 14:06 Nelson H. F. Beebe
2020-03-04 16:17 ` John P. Linderman
2020-03-04 17:25 ` Bakul Shah
2020-03-05 0:55 ` Rob Pike
2020-03-05 2:05 ` Kurt H Maier
2020-03-05 4:17 ` Ken Thompson via TUHS
2020-03-05 14:53 ` Dan Cross
2020-03-05 21:50 ` Dave Horsfall
2020-03-05 21:56 ` Warner Losh
2020-03-08 5:26 ` Greg 'groggy' Lehey
2020-03-08 5:32 ` Jon Steinhart
2020-03-08 9:30 ` Tyler Adams
[not found] ` <CAC0cEp8eFRkkLTw88WVaKZoKy+qsrhuC8LkzmmsbqtdZgMf8eQ@mail.gmail.com>
[not found] ` <CAEuQd1D7+dfap98AwPo2W41+06prrcVaAWk3Ve-ve0uQ0xBu3Q@mail.gmail.com>
2020-03-09 21:06 ` John P. Linderman
2020-03-09 21:22 ` Kurt H Maier
2020-03-11 17:41 ` John P. Linderman
2020-03-11 21:29 ` Warner Losh
2020-03-12 0:13 ` John P. Linderman
2020-03-12 0:34 ` Chet Ramey
2020-03-12 12:57 ` John P. Linderman
2020-03-12 19:24 ` Steffen Nurpmeso
2020-03-08 9:51 ` Michael Kjörling
2020-03-03 18:15 Jon Steinhart
2020-03-03 18:44 ` Adam Thornton
2020-03-04 4:11 ` Tyler Adams
2020-03-04 6:03 ` Dave Horsfall
2020-03-04 6:48 ` arnold
2020-03-04 21:17 ` Dave Horsfall
2020-03-05 0:49 ` Lyndon Nerenberg
2020-03-05 20:54 ` Dave Horsfall
2020-03-05 22:01 ` William Cheswick
2020-03-04 21:50 ` Random832
2020-03-04 23:19 ` Steffen Nurpmeso
2020-03-05 6:12 ` Alan D. Salewski
2020-03-04 22:03 ` Random832
2020-03-04 23:25 ` Terry Jones
2020-03-10 23:03 ` Dan Stromberg
2020-03-11 3:18 ` Dave Horsfall
2020-03-11 4:02 ` Steve Nickolas
2020-03-11 22:56 ` Greg 'groggy' Lehey
2020-03-11 23:14 ` Dan Cross
2020-03-12 0:42 ` Greg 'groggy' Lehey
2020-03-12 0:53 ` Steve Nickolas
2020-03-12 3:09 ` Greg 'groggy' Lehey
2020-03-12 3:34 ` Steve Nickolas
2020-03-13 1:02 ` Greg 'groggy' Lehey
2020-03-12 5:38 ` Dave Horsfall
2020-03-12 6:48 ` Peter Jeremy
2020-03-12 7:37 ` Steve Nickolas
2020-03-12 7:42 ` Warner Losh
2020-03-12 23:57 ` Greg 'groggy' Lehey
2020-03-12 5:22 ` Dave Horsfall
2020-03-12 5:35 ` Steve Nickolas
2020-03-13 0:36 ` Greg 'groggy' Lehey
2020-03-13 11:26 ` Dave Horsfall
2020-03-14 2:13 ` Greg A. Woods
2020-03-14 4:31 ` Greg 'groggy' Lehey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200314202549.I-Zpc%steffen@sdaoden.eu \
--to=steffen@sdaoden.eu \
--cc=jpl.jpl@gmail.com \
--cc=tuhs@tuhs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).