Skip to content

Instantly share code, notes, and snippets.

@subdigital
Created May 7, 2012 12:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save subdigital/2627542 to your computer and use it in GitHub Desktop.
Save subdigital/2627542 to your computer and use it in GitHub Desktop.
Formatting JSON on the command line
#! /bin/sh
# Usage: curl http://some_url/that_returns.json | format_json
python -c "import sys, json; print json.dumps(
json.load(sys.stdin), sort_keys=True, indent=4)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment