Last active
January 16, 2018 06:33
-
-
Save ipan/5616c3e7c6d250986731d146c017a321 to your computer and use it in GitHub Desktop.
formatting json files with jq #json #jq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# jq can not write back to the same file | |
for i in `find . -name '*.json'` | |
do | |
jq '.' $i > $i.tmp | |
mv $i.tmp $i | |
done | |
# oneliner version | |
# for i in `find . -name '*.json'`; do jq '.' $i > $i.tmp && mv $i.tmp $i; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment