Created
May 1, 2017 22:51
-
-
Save noromanba/7ef7ed9ecd079692f18ee3441e8b23b0 to your computer and use it in GitHub Desktop.
beautify json w/ 4-space indent
This file contains 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
#!/usr/bin/env bash | |
# beautify json w/ 4-space indent | |
# @version 2017.4.29.0 | |
# @license CC0 Univ PD https://creativecommons.org/publicdomain/zero/1.0/ | |
# @author noromanba | |
# require sponge(1) provided w/ moreutils | |
set -euC | |
for file in "$@" | |
do | |
python3 -m json.tool < "$file" | sponge "$file" | |
#python -m json.tool < "$file" | sponge "$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment