Created
October 1, 2020 09:29
-
-
Save zealotous/80d02d567826bd09451717381d1279bc to your computer and use it in GitHub Desktop.
YAML to JSON python one-liner example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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