WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: awk oddities  (Read 2702 times)

Offline mocore

  • Hero Member
  • *****
  • Posts: 633
  • ~.~
awk oddities
« on: October 24, 2021, 06:29:45 AM »
hi *

heare are afew  oddities awk found while looking for other compleatly diffrent awk related things

https://github.com/djanderson/aho -  A git implementation in awk


https://github.com/huijunchen9260/fm.awk - File manager written in awk



Offline mocore

  • Hero Member
  • *****
  • Posts: 633
  • ~.~
Re: awk oddities
« Reply #1 on: November 30, 2023, 01:31:58 AM »

a few more

https://github.com/xonixx/makesure # Simple task/command runner with declarative goals and dependencies
https://github.com/xonixx/makesure/blob/main/makesure.awk

https://github.com/ttv1/aok/blob/master/docs/index.md

Quote
AOK is a pre-processor to AWK code that adds:

- Abstract data types;
- Easy methods to list the  attributes and operations of that data;
- Object constructors;
- Nested object constructors.
- Multi-line quotes
- A _dot_ notation for easy reference to nested structures.

As an example of the last point,

```c
emp.name.lname
```

expands to

```c
emp["name"]["lname"]
```

By the way, the magic text substitution  for implementing the above is:

```c
gensub( /\.([a-zA-Z_])([a-zA-Z0-9_]*)/,
        "[\"\\1\\2\"]",
   "g",
   $0
     )
```

https://github.com/xonixx/gron.awk # Similar to tomnomnom/gron but in Awk.

Offline mocore

  • Hero Member
  • *****
  • Posts: 633
  • ~.~
Re: awk oddities
« Reply #2 on: December 02, 2023, 01:16:31 AM »

https://github.com/Gumnos/kv.awk # A dumb key/value store implemented in awk & plain-text files

 perhaps this could be a usefull addition to base  ;)
 to create a sort of
 tinycore registry  :P  to store configuration info etc 
 
eg
Code: [Select]
kv.awk TCLM add Registry-Equivalents_and_alternatives  https://en.wikipedia.org/wiki/Windows_Registry#Equivalents_and_alternatives ;D

 ???
Quote from: en.wikipedia.org/wiki/Windows_Registry#Equivalents_and_alternatives
In contrast to Windows Registry's binary-based database model,
some other operating systems use separate plain-text files for daemon and application configuration,
but group these configurations together for ease of management.

 In Unix-like operating systems (including Linux) that follow the Filesystem Hierarchy Standard,
system-wide configuration files (information similar to what would appear in HKEY_LOCAL_MACHINE on Windows)
are traditionally stored in files in /etc/ and its subdirectories, or sometimes in /usr/local/etc.
Per-user information (information that would be roughly equivalent to that in HKEY_CURRENT_USER) is stored in hidden directories and files (that start with a period/full stop) within the user's home directory.
However XDG-compliant applications should refer to the environment variables defined in the Base Directory specification.[56]

Offline mocore

  • Hero Member
  • *****
  • Posts: 633
  • ~.~
Re: awk oddities
« Reply #3 on: December 03, 2023, 12:18:22 AM »

 # AWK As A Major Systems Programming Language — Revisited
 https://www.skeeve.com/awk-sys-prog.html

 this is particularity interesting imho and contains more links and a du.awk
 as well as some insight into the history of awk 

 the https://github.com/dubiousjim/awkenough readme list some murky edge cases  and workarounds

 Shell, Awk, and Make Should Be Combined
 https://www.oilshell.org/blog/2016/11/13.html
 interesting comparison's
 & more links to other  third-party "standard libraries"  ( awkenough , awk-libs , and the 'A-Library-of-awk-Functions' section in the gawk manual )

 make  implemented in awk

 https://benhoyt.com/writings/awk-make/
 https://github.com/benhoyt/awkmake


 another stdlib
 https://github.com/IMAGE-ET/stdlib OSIX standard library for Awk and shell

 Speculative View on How FP Could Work in AWK
 http://www.btellez.com/posts/fp-awk.html

 Awk, Unix, and functional programming
 http://trevorjim.com/awk-unix-and-functional-programming/

Offline mocore

  • Hero Member
  • *****
  • Posts: 633
  • ~.~
Re: awk oddities : Building a roguelike in awk
« Reply #4 on: January 07, 2024, 10:55:50 PM »

https://jellepelgrims.com/posts/awkventure  8)

an interesting write up of this https://github.com/jpelgrims/awkventure "Console roguelike written in awk " project

... much like huijunchen9260/fm.awk file manager awkventure  includes some basic "Text-based user interface" ( read keypress / draw on terminal )

*tangent:List of projects that provide terminal user interfaces https://github.com/rothgar/awesome-tuis *

Offline mocore

  • Hero Member
  • *****
  • Posts: 633
  • ~.~
Re: awk oddities
« Reply #5 on: August 30, 2024, 08:04:03 PM »

 interesting :o :o find !

 https://github.com/x-cmd/x-cmd #  X bootstrap 1000+ tools and scripts.

this  https://github.com/x-cmd/x-cmd/blob/main/mod/awk/lib/url.awk
appears relevent wrt 'urlencode for piCore' https://forum.tinycorelinux.net/index.php/topic,19353.msg119198.html#msg119198

... while searching for this topic i found awkcalc.sh @  https://forum.tinycorelinux.net/index.php/topic,5561.msg29537.html#msg29537
and also this sentiment is worth echoing hear  ;D
Cool! Yeah awk!

Offline mocore

  • Hero Member
  • *****
  • Posts: 633
  • ~.~
Re: awk oddities
« Reply #6 on: September 14, 2024, 06:07:56 AM »




" Awk script to generate HTML documentation from markdown text in source code comments. "
 https://gist.github.com/wernsey/eb1525876ca5519822ab48e68207970f#comdown.awk ( zip (of text files) attached)

comdown.awk
demo.c
mdown.awk
wrap.awk
xtract.awk