Skip to content
Powerful wrapper for AWK interpreter
Branch: master
Clone or download
Latest commit 83e1991 Feb 15, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples io.awk:file_size was fixed (its behaviour depends on FS value) Dec 26, 2014
modules Sort files locale-independently to get reproducible build Feb 29, 2016
test Merge remote-tracking branch 'pkgsrc-dev/master' Mar 10, 2018
Makefile version -> 1.6.1 Feb 15, 2019



runawk: small wrapper for AWK interpreter that impements modules
system and helps one to write the standalone AWK programs.

author:                                  Aleksey Cheusov <>

project's home page:  

licence:                                                   MIT license



See section MOTIVATION of runawk.1 or runawk.pod.



See INSTALL file.



RunAWK provides lots of AWK modules ready for use. All of them are
under modules/ subdirectory. They are installed by default.

    abort.awk,  alt_assert.awk
                     - power abort() and assert()
    alt_join.awk     - join :-)
    braceexpand.awk  - awk equivalent to shell's braceexpand functionality
    basename.awk, dirname.awk
                     - equivalents to basename(1) and dirname(1)
    embed_str.awk    - reads strings from AWK code
    exitnow.awk      -
    has_prefix.awk, has_suffix.awk
                     - trivial string functions
    match_br.awk     - find pair closed brackets in a string
    max.awk, min.awk, isnum.awk, abs.awk
                     - trivial math functions
    modinfo.awk      - routines to get an information about modules that
                       are in use
    multisub.awk     - another replacement functions
    pow.awk          - synonym for ^
    init_getopt.awk, alt_getopt.awk, power_getopt.awk
                     - POSIX/SUS compatible routines
                       for handling options EASILY ;-)
    readfile.awk     - read an entire file into variable
    runcmd.awk       - safe wrapper over system()
    shquote.awk      - escapes shell's special characters
    heapsort.awk, quicksort.awk, sort.awk
                     - sorting functions
    str2regexp.awk   - string to regexp routines
    tokenre.awk      - alternative mechanism for separating input into tokens
    xclose.awk, xgetline.awk, xsystem.awk
                     - functions to write robust programs
    tmpfile.awk      - generates names of automatically deleted tempfiles
    fieldwidths.awk  - portable equivalent of GNU awk's FIELDWIDTHS ;-)
    CR_in.awk        - removes CR symbols from input lines.
    trim.awk         - functions for trimming spaces from the string.
    trim_in.awk      - trims spaces from input lines.
    backslash_in.awk - treats backslash symbol at the end of line as
                       "this line will continue on the next one".
    ini.awk          - functions for reading Win .ini files.
    ftrans_in.awk    - handle data file transitions
    ord.awk          - character to id and id to character convertors



RunAWK also provides a few scripts:

   alt_getopt     - program arguments parser aware of long options,
                    alternative to POSIX getopts and getopt(1).
                    In addition to alt_getopt(1) utility
                    shell library is also provided that provides
                    an alternative way for handling options.  - shell library functionally equivalent
                    to alt_getopt(1)



Lots of examples are available in examples/ subdirectory.



  1) NetBSD, DragonFlyBSD, Linux, Solaris... (pkgsrc)

    RunAWK is packaged in pkgsrc as wip/runawk.

  2) FreeBSD

    RunAWK is packaged in FreeBSD ports as lang/runawk

  3) Debian/lenny/x86

    Add the following lines

        deb       lenny    main
        deb-src       lenny    main

    to /etc/apt/sources.list and then using apt or aptitude commands.
    Binary packages are available only for Debian/Lenny/i386.
    Ubuntu users need to recompile the package for their system.
You can’t perform that action at this time.