Skip to content

Instantly share code, notes, and snippets.

@zealotous
Created October 1, 2020 09:29
Show Gist options
  • Save zealotous/80d02d567826bd09451717381d1279bc to your computer and use it in GitHub Desktop.
Save zealotous/80d02d567826bd09451717381d1279bc to your computer and use it in GitHub Desktop.
YAML to JSON python one-liner example
echo -e "services: {a: 'foo'}" \
| python -c "import sys; import json; import yaml; print(json.dumps(yaml.safe_load(''.join(l for l in sys.stdin))))" \
| jq .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment