> 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.
> 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.
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.
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)