🐒 manyawk is the AWK library that provides many comprehensive AWK utility functions.
This manyawk library structure is inspired by Golang packages structure.
To get manyawk:
$ git clone https://github.com/b4b4r07/manyawk
Then you'll need to set the AWKPATH environment variable to this library directory root when using manyawk.
$ export AWKPATH=/path/to/manyawk # this library
You must load modules from manyawk you want to use and add @include "module/module.awk"
to your awk script.
#!/usr/bin/env gawk -f
@include "math/similarity.awk"
BEGIN {
printf("%f%\n", similarity(ARGV[1], ARGV[2]))
}
To save the awk script above as leven_dist.awk
, and to run:
$ AWKPATH=. awk -f leven_dist.awk "awk is fun" "gawk is fun"
95.238095%
MIT © BABAROT (a.k.a. b4b4r07)