Skip to content

Instantly share code, notes, and snippets.

@jworl
Created June 29, 2017 14:54
Show Gist options
  • Save jworl/ec243a1ea2814e8c02495df552e2cda4 to your computer and use it in GitHub Desktop.
Save jworl/ec243a1ea2814e8c02495df552e2cda4 to your computer and use it in GitHub Desktop.
yaml2json function within bash
# requires PyYAML
_YAML2JSON(){
python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment