celesto
Secure and persistent computer for AI agents
Pure Java AWK for command-line use and Java embedding.
Developer toolsJava · AwkGitHub @jawkioOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Java AWK interpreter
Translation pending
Loading the full README.
Read the full README ↗
Jawk is a pure Java implementation of AWK. You can run it as a CLI, embed it directly in Java applications, compile scripts once and reuse them, evaluate AWK expressions, feed it structured input, expose your own Java functions as extensions, and enable a sandboxed runtime when you need tighter execution constraints.
Jawk fully implements POSIX AWK, and adds support for the most commonly used gawk-specific features:
asort(), asorti(), typeof(), isarray(), mkbool(), gensub(), patsplit(), strtonum(), systime(), mktime(), strftime(), the gettext functions, and PROCINFO["sorted_in"]-controlled array traversala[i][j]), with gawk's runtime typing rules, and typed regexp literals (@/re/)@include, namespaces with @namespace and ns::name, and indirect function calls such as @functionName(args)BEGINFILE / ENDFILE special patterns and the nextfile statement, with the ERRNO and ARGIND special variables, so a script can hook into the command-line file processing loop and skip unreadable files without a fatal errorIGNORECASE, SYMTAB, and FUNCTAB special variables/dev/stdout, /dev/stderr, and /dev/stdin special filenames in redirections and getline, plus /dev/null on WindowsThe gawk-specific @ syntax and arrays-of-arrays syntax are rejected in --posix mode.
See the compatibility page for detailed behavior notes and live compatibility reports against the POSIX, One True Awk, and gawk test suites.
Install the jawk command with one line; the launcher finds a Java runtime (Java 8 or later) automatically:
curl -fsSL https://jawk.io/get | sh
On Windows (PowerShell):
irm https://jawk.io/get.ps1 | iex
See the installation page for details, Maven/Gradle coordinates, and the standalone jar.
echo "hello world" | jawk '{ print $2 ", " $1 "!" }'
The CLI follows the POSIX argument conventions, and passes unknown options on to the script through ARGV once the program text has been supplied, as gawk does, which makes #! interpreter scripts work. See the CLI documentation for details.
Awk awk = new Awk();
String result = awk.script("{ print toupper($0) }").input("hello world").execute();
The variables passed to an embedded script may be Map and List trees, so JSON-like structures can be traversed with plain AWK array syntax. See the Java documentation for details.
See CONTRIBUTING.md.