The modern hero of shell scripts is jq. Pipe in JSON, find values, store back into variables or create new JSON and work with that. Unfortunately my data was in PostgreSQL, and the psql output…