💾 Archived View for rawtext.club › ~zilog › 2024-03-18-znews.txt captured on 2024-03-21 at 16:58:34.

View Raw

More Information

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

Mon 18 Mar 2024 10:26:41 PM UTC

Had been wanting to try my hand at an AWK-based shlog reader for a while
and when I noticed some people's posts were not displaying in the default
client though their permissions were fine I decided now was a good time:

  $ ~zilog/public_bin/shlawk ?

   a simple RTC shlog reader written in AWK.

    use:  shlawk [?|N] ; N = # posts to display (10 default)

   selected posts are displayed via less(1).

The number of lines in the user's TERM gets used to page listings if
N is more than can be displayed in one screen.  Also some people stick
non-shlog files in their ~/.shlog/ directory so files that don't begin
with "20" are excluded.  Post titles wider than 50 chars get displayed
truncated in listings, ie.,  "this is too wide...".

Displaying last 5 posts (narrowed slightly for this post):
 --
 $ ~zilog/public_bin/shlawk 5

 [:shlawk:]  RTC shlog reader :: displaying last 10 posts..

 2024-03-18  Re:_Backing_up_RTC_files.txt              jmq             [1]
 2024-03-18  Backing-up-RTC-files                      mrpieceofwork   [2]
 2024-03-14  Re:_Buying_Music.txt                      jmq             [3]
 2024-03-08  Nex_and_perl_adventure.txt                gorf            [4]
 2024-03-07  knight_vs_bishop_endgame.txt              jmq             [5]

 enter post # or (q)uit: 
 --

Since nawk is now available on RTC I opted not to make use of any Gawk
extensions and stuck to plain POSIX AWK.  The only drawback is there is
no good way to pass a dashed argument such as "--help" to a nawk script;
it displays an "unknown option" message then runs the script with the
defaults, fortunately not so bad in this case.