Converted inline awk script to bash
Converted inline awk script to bash

Made the "add" handler faster by replacing a slow awk script
with the mapfile builtin, a helper function, and some shell
arithmetic.

clarity20/fasder