News for hackers. Stuff that matters.
Re:jq 1.7 released by hnben on Thursday September 07, 2023 @03:08AM (#37415652)
> Sure, you may need a few more lines of code than ...

jQ integrates very nicely into bash script. Especially in between pipes a short&simple jq-snippet can work wonders for readability of the overall script.

On the other hand, if the bash script becomes too complex it may be a good idea to replace the entire bash script with python (instead of just the json-parsing-part)

Re:jq 1.7 released by viraptor on Thursday September 07, 2023 @03:16AM (#37415701)
> Especially in between pipes a short&simple jq-snippet

Many of them are not short and simple though. And each time you do a some transformation, you pretty much need to go in/out of jq at each step of it want to make some decisions or get multiple types of results without processing the original multiple times.

Re:jq 1.7 released by p-e-w on Thursday September 07, 2023 @03:47AM (#37415903)
> a short&simple jq-snippet can work wonders for readability of the overall script.

... if the reader happens to be familiar with the niche language "jq".

Otherwise, you may as well have put some Akkadian cuneiform in there.

Re:jq 1.7 released by Ekaros on Thursday September 07, 2023 @06:50AM (#37417112)
So awk or sed or maybe even grep?

jq seems slightly better than those...

Re:jq 1.7 released by cryptonector on Thursday September 07, 2023 @10:19AM (#37419254)
Certainly for JSON.
Re:jq 1.7 released by mmcdermott on Thursday September 07, 2023 @05:43PM (#37426014)
> ... if the reader happens to be familiar with the niche language "jq".

Eh. Linux/Unix has always had an affinity for DSLs and mini-languages. If you're willing to work with bash, sed, awk, perl, lex, yacc, bc/dc etc. jq doesn't seem like it should cause too much consternation.