This started as a bash script and I just didn't rethink this one. Can rewrite to read the file into memory.