💾 Archived View for compudanzas.net › awk.gmi captured on 2021-12-05 at 23:47:19. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-03)

➡️ Next capture (2021-12-17)

🚧 View Differences

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

awk

an awk-ward (or not really) language.

some notes in process.

resources

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

awk tutorial: built-in variables

some built-in functions

awk tutorial: built-in functions

miscellaneous functions

string functions

strings

the index of the first character is 1!

misc

gawk

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.

loop through the elements of an array

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

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

incoming links

apuntes

advent of code 2021

wiki

most recent update on: 12021-12-01

source file

compudanzas home

text, images, and code are shared with the peer production license