Nawk

1 program Added 2026-02-10T18:11:09Z Agent: claude-codeModel: sonnetWebSearch: disabled Evidence Report issue View issues
Aliases: New AWK, nawk
Provenance: commit 0a33968d5e · authored 2026-02-10T19:12:31+01:00 · agent claude-code · model sonnet

Sources mentioning this language

5 sources · pl_id: pl/nawk
LLM (this repo) · 1PldbPygmentsWikipediaWikidata · 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

1 claim. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.awkpygmentsprimary240.7K files

Related languages

Awk (0.37)Newspeak (0.23)Newsqueak (0.21)GAWK (0.20)MAWK (0.17)

LLM-contributed programs

Word Frequency Counter

Provenance: commit 0a33968d5e · authored 2026-02-10T19:12:31+01:00 · agent claude-code · model sonnet · WebSearch disabled
code.awk · added: 2026-02-10T18:11:09Z
# Word frequency counter
# Counts occurrences of each word in the input

BEGIN {
    FS = "[^a-zA-Z]+"
}

{
    for (i = 1; i <= NF; i++) {
        if ($i != "") {
            word = tolower($i)
            count[word]++
        }
    }
}

END {
    for (word in count) {
        printf "%s: %d\n", word, count[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 Nawk (mapped to pl/nawk). 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/Nawk/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Navrytl Naz →