GAWK

1 program Added 2026-02-11T12:13:02.166396Z Agent: claude-codeModel: sonnetWebSearch: disabled Evidence Report issue View issues
Aliases: GNU Awk, gawk
Provenance: commit e510ede5a9 · authored 2026-02-11T13:13:31+01:00 · agent claude-code · model sonnet

Sources mentioning this language

8 sources · pl_id: pl/awk
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q213970

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsscripting · procedural · data-driven
Typingnone; can handle strings, integers and floating-point numbers; regular expressions
Designed byAlfred Aho · Peter Weinberger · and Brian Kernighan
First appeared1977
Influenced byC · sed · SNOBOL

Extensions claimed by this language

6 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.awklinguistprimary240.7K files
.awkpygmentsprimary240.7K files
.auklinguistsecondary294 files
.gawklinguistsecondary2.5K files
.mawklinguistsecondary220 files
.nawklinguistsecondary249 files

Related languages

Awk (0.37)GNU APL (0.26)GAS (0.23)GNU Poke (0.21)Nawk (0.20)

LLM-contributed programs

Word Frequency Counter

Provenance: commit e510ede5a9 · authored 2026-02-11T13:13:31+01:00 · agent claude-code · model sonnet · WebSearch disabled
code.awk · license: GPL-3.0 · added: 2026-02-11T12:13:02.166396Z
#!/usr/bin/gawk -f
# Word frequency counter
# Counts the frequency of each word in the input

{
    # Convert to lowercase and split into words
    for (i = 1; i <= NF; i++) {
        word = tolower($i)
        # Remove punctuation
        gsub(/[^a-z0-9]/, "", word)
        if (length(word) > 0) {
            freq[word]++
        }
    }
}

END {
    # Print words and their frequencies, sorted by frequency
    n = asorti(freq, sorted_words, "@val_num_desc")
    print "Word Frequency Report"
    print "===================="
    for (i = 1; i <= n && i <= 20; i++) {
        word = sorted_words[i]
        printf "%-20s %5d\n", word, freq[word]
    }
}

Real programs from Software Heritage

1 sample mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
ns_passwd.awk · 1282 B · ext .awk · seen 103× in SWH
via fallback
swh:1:cnt:b9b6bce570f3042048358acc9c5d7b3f2c9baa39;origin=https://github.com/mbuilov/gawk-windows;anchor=swh:1:rev:663aff4ae012468c54d2e994e839d0e75210ef80;path=/awklib/eg/lib/ns_passwd.awk
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
# ns_passwd.awk --- access password file information
#
# Arnold Robbins, arnold@skeeve.com, Public Domain
# May 1993
# Revised October 2000
# Revised December 2010
#
# Reworked for namespaces June 2017, with help from
# Andrew J.: Schorr, aschorr@telemetry-investments.com

@namespace "passwd"

BEGIN {
    # tailor this to suit your system
    Awklib = "/usr/local/libexec/awk/"
}

function Init(    oldfs, oldrs, olddol0, pwcat, using_fw, using_fpat)
{
    if (Inited)
        return

    oldfs = FS
    oldrs = RS
    olddol0 = $0
    using_fw = (PROCINFO["FS"] == "FIELDWIDTHS")
    using_fpat = (PROCINFO["FS"] == "FPAT")
    FS = ":"
    RS = "\n"

    pwcat = Awklib "pwcat"
    while ((pwcat | getline) > 0) {
        Byname[$1] = $0
        Byuid[$3] = $0
        Bycount[++Total] = $0
    }
    close(pwcat)
    Count = 0
    Inited = 1
    FS = oldfs
    if (using_fw)
        FIELDWIDTHS = FIELDWIDTHS
    else if (using_fpat)
        FPAT = FPAT
    RS = oldrs
    $0 = olddol0
}

function awk::getpwnam(name)
{
    Init()
    return Byname[name]
}

function awk::getpwuid(uid)
{
    Init()
    return Byuid[uid]
}

function awk::getpwent()
{
    Init()
    if (Count < Total)
        return Bycount[++Count]
    return ""
}

function awk::endpwent()
{
    Count = 0
}

Contribute — propose a file extension

Tell us where to find evidence about GAWK (mapped to pl/awk). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/GAWK/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← gaussfit GAXT →