💾 Archived View for rawtext.club › ~zilog › 2023-10-29-znews.txt captured on 2023-12-28 at 16:50:29.

View Raw

More Information

⬅️ Previous capture (2023-11-04)

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

Sun 29 Oct 2023 05:20:16 PM UTC

Continuing my AWK explorations I've written a query tool which lists
the N most recent e-book additions to the RTC lending library:

  --
  ~$ ~zilog/public_bin/recent_books.awk -h
  
   Returns the N most recently added RTC library books.
  
    usage:  recent_books.awk [ -h | N ] ; N defaults to 10
  
     made with GNU Awk, version 5.2.2
  
  ~$ ~zilog/public_bin/recent_books.awk 7
  
  :: RTC lending library - recent additions ::
  
   :added:      :size:    :full path to e-book:
  2023-06-26   27.2 MB    /home/***/books/Oil_Power_and_War-a_dark_history.epub
  2023-06-09    3.4 MB    /home/***/books/Ultrasocial-JohnGowdy.pdf
  2023-05-29    1.1 MB    /home/***/books/Overshoot-WillCatton.epub
  2023-04-06    0.7 MB    /home/***/books/christoyannopoulos-christian-anarchism.epub
  2023-03-19    0.2 MB    /home/***/books/frances-hodgson-burnett_the-secret-garden.gpub
  2023-03-18    0.6 MB    /home/***/books/frances-hodgson-burnett_the-secret-garden.epub
  2022-10-07    3.3 MB    /home/***/books/QED-Text-Editor_by_DMR_and_KLT_19700622.epub
  --

The tool makes use of gawk-specific features, namely it's support for
shared library extensions.  gawk comes with several native shared library
extensions, sort of a "demonstration kit", of which recent_books.awk makes
use of two: readdir(3am) and filefuncs(3am).  The latter is particularly
useful as it provides access to a number of file/dir functions that one
would otherwise have to rely on operating system tools for.  Glancing at
the man page suggests possible further refinement of recent_books.awk
such that the readdir(3am) functions can be replaced with filefunc(3am)
functionality.