💾 Archived View for rawtext.club › ~zilog › 2024-01-18-znews.txt captured on 2024-02-05 at 11:30:06.

View Raw

More Information

-=-=-=-=-=-=-

Thu 18 Jan 2024 09:32:23 PM UTC

Mostly as a refresher on Gawk's network capabilities (and limitations),
I wrote ~zilog/public_bin/fingr, a simple finger client; should be
executable by anyone on RTC.

The finger protocol is probably one of the simplest, literally a
one-liner, so a good choice for educational endeavors as getting bogged
down in protocol specifics as there hardly are any.

Although Gawk has had 2-way network pipe capability for over a decade it
still largely lacks native error handling so when something goes wrong
non-trappable nasty messages are outputted.  Two situations were encountered
in this case: 1) hostname is non-resolvable, 2) host has no finger server.

In case 1) there really was no native way to gracefully fail so I resorted
to predetermining routeability via the system's host(1) command, a small
ubiquitous tool that is widely present at least in the Linux/Unix world.

Case 2) was easier to deal with; Gawk provides PROCINFO[<file>,"NONFATAL"]
which also works with the Gawk-only special network socket filenames,
"/inet/tcp/0/<hostname>/79" in this case. Any read/write error will
populate the ERRNO variable which can then be tested.

Anyway for now fingr only works with remote finger lookups. At some point
I may try an AWK-based emulation of the pinky(1) tool for local lookups.