Skip to content

Instantly share code, notes, and snippets.

@sonnyksimon
Created September 16, 2023 11:32
Show Gist options
  • Save sonnyksimon/8f70609467eef3e7a2b2de4022617e75 to your computer and use it in GitHub Desktop.
Save sonnyksimon/8f70609467eef3e7a2b2de4022617e75 to your computer and use it in GitHub Desktop.
#!/usr/bin/sh
# yaml2json
cat myFile.yml | python -c 'import yaml; import json; import sys; f = sys.stdin.read(); conf = yaml.safe_load(f); out = json.dumps(conf, separators=(",",":")); print(out)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment