Skip to content

Instantly share code, notes, and snippets.

@joshbooks
Created November 29, 2018 22:46
Show Gist options
  • Save joshbooks/d530e92344cbcb9ce606999bc172cc8f to your computer and use it in GitHub Desktop.
Save joshbooks/d530e92344cbcb9ce606999bc172cc8f to your computer and use it in GitHub Desktop.
pretty print json
#!/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