NAME

Yash - A script to load YAML file inside shell scripts

VERSION

Version 0.2

SYNOPSIS

yash [-f file] [--scalar|--array|--hash|--count] [path]

USAGE

Print the content of a node (in YAML):

yash [path]

Check if the reached item is a scalar/array/hash:

yash [--scalar|--array|--hash] [path]

Count the size of a list, the number of keys of a hash (returns 1 for a scalar):

yash --count [path]

Print the values of a list or a hash (at least one line for each element, but some elements can take several lines as they are dumped in YAML)

yash --values [path]

Print the keys of a hash (one line per key, in plain text):

yash --keys [path]

Path is the sequence of array indexes or hash keys needed to reach the wanted node. It can be omitted in order to select the root node.

YAML data can come from the standard input or from the file given by the -f option.

See the tests for more examples.

Note: for --keys you should use a while loop instead of a for loop to avoid problems with spaces in values.

yash -f $CONFIG | while read line; do
  print $line
done

BUGS

Please use rt.cpan.org for tracking bugs. The list of current open bugs is at http://rt.cpan.org/Dist/Display.html?Queue=Yash.

To report a new bug, go to https://rt.cpan.org/Public/Bug/Report.html?Queue=Yash

AUTHOR AND COPYRIGHT

Copyright (c) 2010 Olivier Schwander <olivier.schwander@ens-lyon.org>

LICENSE

Yash is free software. You can redistribute it and/or modify it under the same terms as Perl itself.