pkoppstein

Results 169 comments of pkoppstein

@svnpenn - My apologies if I over-generalized, but the GNU awk documentation characterizes "inplace editing" as "an extension" (https://www.gnu.org/software/gawk/manual/html_node/Extension-Sample-Inplace.html). Also, your example does not work with the GNU awk installed...

There is now a Q&A about "in-place editing" in the FAQ: https://github.com/stedolan/jq/wiki/FAQ#general-questions

Some recommended and some not-recommended workarounds are covered on the FAQ page at "General Questions": https://github.com/stedolan/jq/wiki/FAQ#general-questions

@svnpenn - Done.

@svnpenn - Neat. If that works on Windows, then it would be worthwhile having your slurp() packaged as sponge.bat since neither moreutils in general nor sponge in particular seems to...

> I want to mass update many files. Since you have a particular scenario in mind, you would probably be best off writing a script to do what you want,...

@mnpenner - To use `sponge` with `find`, you could write s.t. like: find /some/dir -name "*.json" | while read -r f ; do jq 'filter_here' "$f" | sponge "$f" ;...

@metashock - The proposed -i option would probably not work that way (*), which is in a sense the main point - previous attempts to implement the feature have run...

Using > or tee is at best a bad idea unless your shell or version of tee specifically documents that it can be used in the desired way. For more...

@daixiangzi - You've asked for the JSON to be "pretty-printed", so why are you surprised? If you want the JSON to be compressed, use the -c command-line option. If you...