5.4.15

Format json files recursively

I often find myself in need of formatting multiple json files, recursively. 

Here's a snippet to do this.
for f in `find ./ -name *json`; do echo $f ; python -mjson.tool $f > /tmp/1 && cp /tmp/1 $f ; done
But is there a better way, i.e. a methodology which has no side effects ?

I asked on stackoverflow.  We'll see if someone responds !


No comments:

Post a Comment