Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
yaml2json python bash alias one liner
# https://medium.com/@frontman/how-to-parse-yaml-string-via-command-line-374567512303
alias yaml2json="python3 -c 'import sys,json,yaml;f=open(sys.argv[1]);d=yaml.safe_load(f);f.close();print(json.dumps(d))'"
# yaml2json ./vars.yml | jq ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment