icono de compudanzas


an awk-ward (or not really) language.

some notes in process.


the static site generator for the compudanzas.net wiki is mostly written in awk:

generator and source files for the compudanzas.net site

g2e is an opinionated gempub to epub converter written in awk:


my solutions for advent of code 2021 have been written in awk.


gawk user's guide

awk tutorial: tutorialspoint

some built-in variables

$0 represents the entire input record, and $n the nth field in the current record (starting to count from 1)

awk tutorial: built-in variables

some built-in functions

awk tutorial: built-in functions

miscellaneous functions

string functions


the index of the first character is 1!


Explicit Input with getline

The getline command is used in several different ways and should not be used by beginners.



gawk user's guide

bit-manipulation functions

note: to run in compatibility mode, without gnu extensions, use the -c or --traditional flag:

$ awk -c

other notes

record separation

records separated by empty lines can be extracted with:

RS = ""

without modifying FS, fields will be separated by any whitespace, including newlines.

gawk allows regexp in RS, traditional awk will only accept one character.

field separation

one can get one character at a time by setting (in gawk?) :

FS = ""

loop through the elements of an array

arr["a"] = 1
arr["b"] = 2

for(key in arr)
  print key ": " arr[key]

incoming links

advent of code 2021

introducción a programación uxn

introduction to uxn programming book