Skip to content
Yaml parsing for BASH.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE
_static
build
src
test
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
LICENSE
Makefile
README.md
ysh

README.md

Yaml.sh

Build Status


Yup. A YAML parser completely in bash. I can't believe it either.

At the moment, we support a subset of the yaml spec.

Getting Started

Install it:

$ curl -s https://get.yaml.sh | sh

Then query with it:

$ ysh -f my.yml -q "path.to.awesomeness"

Library use

If installed:

YSH_LIB=1;source /usr/local/bin/ysh

If you want the internet as your only dependency:

$ YSH_LIB=1;source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/azohra/yaml.sh/v0.1.5/ysh)"

Flags

-f, --file <file_name>

Read from a file.

-T, --transpiled <file_name>

Read from a pre-transpiled string.

-q, --query <query>

Generic query string.

-Q, --query-val <query>

Safe query. Guarentees the return is a value.

-s, --sub <query>

Query for a subtree of yaml. Guarentees results are a subtree and no values are returned.

-l, --list <query>

Query for a list.

-L, --list <query>

Query for a list of values. Guarentees results are all values.

-c, --count <query>

Query for a list and count the elements.

-i, --index <i>

Access i'th element from chained list query.

-I, --index-val <i>

Access i'th element from chained list query. Garentees result is a value.

-t, --tops

Return top level keys of structure.

-n, --next

Moves to next block

-h, --help

Show this help dialog.

For more complete usage and examples look at the docs.


Made with ❤️ by the developers at azohra.com

You can’t perform that action at this time.