Skip to content

Instantly share code, notes, and snippets.

@dalejung
Created August 7, 2016 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dalejung/2a85ed64c8db66b3533e79f3b2b2ca43 to your computer and use it in GitHub Desktop.
Save dalejung/2a85ed64c8db66b3533e79f3b2b2ca43 to your computer and use it in GitHub Desktop.
json.sh
function tempjson() {
temp_file=$(mktemp)
while read -r LINE; do
echo $LINE >> "$temp_file"
done
export _temp_json=$temp_file
}
alias jcli="tempjson && ipython -i -c \"import json, os; f = open(os.environ['_temp_json']); data = json.load(f); f.close()\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment