Mattias Wadman

Results 823 comments of Mattias Wadman

Not sure if correct but i think the query gets parsed as: ``` $ jq '.[] | (. + (1 as $tt | .))'

👍 Dont think so but there is a issue related to it https://github.com/stedolan/jq/issues/2425

@ksa-real If you want to play around with AST:s then [fq](https://github.com/wader/fq) exposes [gojq](https://github.com/itchyny/gojq):s query functions as jq functions (are _functions as they are not "public") ```jq $ fq -n '".[]|.+1...

Strange, could it be that you downloaded from the [tags page](https://github.com/stedolan/jq/tags) and not [releases](https://github.com/stedolan/jq/releases)? ```sh $ curl -sL 'https://github.com/stedolan/jq/releases/download/jq-1.6/jq-1.6.tar.gz' | tar t | grep '^jq-1.6/configure$' jq-1.6/configure ```

Not sure but i think "Source code (tar.gz)" is just the files in the repo (no configure file) and jq-1.16.{tar.gz,zip} are the result from automake dist (a configure script it...

@alon-k you mean something like this? ``` $ echo '{"a":1,"b":2,"c":[{"d":1,"e":2},{"d":2,"e":3}]}' | \ jq 'def pick(p): . as $v | reduce path(p) as $p ({}; setpath($p; $v | getpath($p))); pick(.a, .c[].d)'...

👍 Nice, thanks for sharing

@alon-k `-f` might be interesting if you want to read a script from a file

what does `diff -u raw_file_json format.json` say? i would guess jq reformats it differently somehow

Good idea i think. Had a look at the wiki and found this https://github.com/stedolan/jq/wiki/jq-Language-Description#operators-priority, maybe it can be extended?