Skip to content

Instantly share code, notes, and snippets.

@pwillis-els
Created September 30, 2020 20:10
Show Gist options
  • Save pwillis-els/918dd116fc9aab40f6298346e1137a5f to your computer and use it in GitHub Desktop.
Save pwillis-els/918dd116fc9aab40f6298346e1137a5f to your computer and use it in GitHub Desktop.
Python one-liner to print out the values of keys specified as command-line arguments
#!/bin/sh
python -c 'import sys,json;j=json.load(sys.stdin); a=sys.argv[1:]; print("\n".join([j[k] for k in a]))' "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment