This playground implements a faithful subset of POSIX awk in pure JavaScript β no server, no WASM β verified against real gawk. EREs are translated to JavaScript regex. There is no filesystem, so getline, print > file, | cmd, and system() degrade gracefully (redirections write to stdout with a note).
| rules | pattern { action }, bare pattern (prints $0), bare { action }, BEGIN {}, END {}, and /re/,/re/ ranges. |
| fields | $0 $1 β¦ $NF, $(expr), assigning fields (rebuilds $0 with OFS), assigning $0 re-splits. |
| vars | NR NF FNR FS OFS ORS RS SUBSEP CONVFMT OFMT RSTART RLENGTH; -F and -v. |
| operators | arithmetic + - * / % ^, ++ --, comparisons, && || !, ternary ?:, concat, ~ !~, in, assignment ops. |
| control | if/else, while, do/while, for(;;), for(k in a), break continue next exit return delete. |
| arrays | associative a[k], multi-subscript a[i,j], k in a, delete, user functions. |
| builtins | length substr index split sub gsub match sprintf, sin cos atan2 exp log sqrt int rand srand, tolower toupper, and printf. |
Everything runs locally; nothing is uploaded.