Skip to content
mattx edited this page Sep 6, 2023 · 3 revisions

One true awk

One true awk is an awk implementation based on the source code of awk versions developed by the original awk authors.

The source code for awk.com can be found in the third_party/awk folder.

Build Instructions

git clone https://github.com/jart/cosmopolitan && cd cosmopolitan
build/bootstrap/make.com -j o//third_party/awk/awk.com

Usage Examples

Get a list of all users on the system:

$ o/third_party/awk/awk.com 'BEGIN { FS=":" } {print $1}' /etc/passwd
root
daemon
bin
[...]

Print the line numbers where a pattern matches:

$ o/third_party/awk/awk.com '/yoink/{print NR}' README.md
138
139

Download

This program is available in precompiled form.

curl https://justine.lol/awk/awk-2022-08-22.com -o awk.com
chmod +x awk.com

Documentation

Clone this wiki locally