Skip to content

Instantly share code, notes, and snippets.

@ambud
Created July 22, 2016 20:03
Show Gist options
  • Save ambud/d256666d588fbf46aeb0b7ba03c0befd to your computer and use it in GitHub Desktop.
Save ambud/d256666d588fbf46aeb0b7ba03c0befd to your computer and use it in GitHub Desktop.
Output pretty JSON in bash
echo '<JSON>' | python -c'import fileinput, json; print(json.dumps(json.loads("".join(fileinput.input())), sort_keys=True, indent=4))'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment