Why am I writing this in BASH? Variables are awful