Crudini

From Christoph's Personal Wiki
Revision as of 01:05, 27 October 2015 by Christoph (Talk | contribs) (New page: '''<tt>crudini</tt>''' is a utility to simplify reading and updating ini/conf files from shell scripts, so named as it provides CRUD (Create/Read/Update/Delete) functionality. ==Example u...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

crudini is a utility to simplify reading and updating ini/conf files from shell scripts, so named as it provides CRUD (Create/Read/Update/Delete) functionality.

Example usage

  • Create a test conf file:
$ cat << EOF > foobar.conf
[host]
foo=bar
ip=10.0.0.2
EOF
  • Get the value of a given key:
$ crudini --get foobar.conf host ip #=> 10.0.0.2
  • Change the value of a given key:
$ crudini --get foobar.conf host foo #=> bar
$ crudini --set foobar.conf host foo baz
$ crudini --get foobar.conf host foo #=> baz

External links