Skip to content

Instantly share code, notes, and snippets.

@drocamor
Created February 22, 2013 15:13
Show Gist options
  • Save drocamor/5014102 to your computer and use it in GitHub Desktop.
Save drocamor/5014102 to your computer and use it in GitHub Desktop.
Uses Python to clean up JSON
#!/bin/bash
TMPFILE=`mktemp /tmp/prettyjson.XXXXXX` || exit 1
python -mjson.tool $1 > $TMPFILE || exit 1
mv $TMPFILE $1 || exit 1
@DarkMukke
Copy link

I added this line to my ~/.bashrc file so I can use this script anywhere :

alias prettyjson="~/pretty-json.sh"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment