Created
November 29, 2018 22:46
-
-
Save joshbooks/d530e92344cbcb9ce606999bc172cc8f to your computer and use it in GitHub Desktop.
pretty print json
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
#!/bin/bash | |
sed -e 's/\([{},]\)/\n\1\n/g' | awk '/\{/ {s += 1} /\}/ {s -= 1} {printf "%*s %s\n", s*2, "", $0}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment