This repository contains text format parsers written in Bash which are particularly useful for configurations, for example in build scripts.
The INI parser has the following usage pattern:
./ini.sh <action> [action-arg] <input-file>All actions except
--helpsupport the argument-o <path>or the alternative--output <path>which tells where to write the result. If the no output path is given,stdoutis used.
List all sections in the file, one item per line. This action does not need any specialized arguments.
./ini.sh --list-sections configuration.ini -o sections.txtList all fields within a section. This action requires the name of the section of which to get the fields.
./ini.sh --list-fields Arguments configuration.ini -o fields.txtReturns the value identified right after the action in the format of
<section>:<key>. An example for it is:
./ini.sh --get-value General:Name configuration.ini -o name.txt