Awk

1 program Added 2025-10-22T09:55:08Z Model: anthropic/claude-3.5-sonnetTemp: 0.4 Evidence Report issue View issues
Aliases: gawk, mawk, nawk
Provenance: commit 3365814629 · authored 2025-10-22T11:55:08+02:00 · model anthropic/claude-3.5-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

GAWK (0.37)Nawk (0.37)MAWK (0.32)Magik (0.11)Actalk (0.10)

LLM-contributed programs

CSV Field Extractor

Provenance: commit 3365814629 · authored 2025-10-22T11:55:08+02:00 · model anthropic/claude-3.5-sonnet · Temp 0.4
code.awk · license: MIT · added: 2025-10-22T09:55:08Z
#!/usr/bin/awk -f
BEGIN{
    FS = ","
    OFS = ":"
}
{if(NR > 1) print $1,$4}

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 Awk (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/Awk/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Awib AWL →