News for hackers. Stuff that matters.
Re:Parsing JSON at the CLI: A Practical Introduction to jq a... by Arnavion on Monday December 21, 2020 @08:47PM (#25501965)
>Right, the ".." part was hard to remember because it's something like:

You misunderstand. The command I wrote is meant to be used as I wrote it. `..` is not a placeholder for you to replace.

https://stedolan.github.io/jq/manual/#RecursiveDescent%3a%2e...

>and as you can see the field fileURL is actually an object with another field en-US (with a hyphen) so the jq becomes something like this:

Sure, so then it's:

    <file.json jq '.. | select(.fileURL?).fileURL["en-US"] | select(startswith("http://"))' -r
Re:Parsing JSON at the CLI: A Practical Introduction to jq a... by donut on Tuesday December 22, 2020 @01:34PM (#25509533)
Oh, I had no idea ".." was an operator. That's a pretty cool feature, combined with the "?" to match optional objects.

Thanks for explaining!