Oof, that "don't" in the code comment within the single quotes was causing your single quoted command to end, causing the command to be parsed incorrectly in your shell. I wonder if that was the only issue originally because it actually looks pretty good to me. Regardless, I can tell you with confidence it would take much less time for me to construct a working version based on the first input than starting from RTFM, despite already having some jq experience myself. Was this 3.5 or 4?