Elektra
0.9.0
|
The โmaybe this is not INIโ plugin (mini
) is a very simple storage plugin loosely based on the INI file format. Since this plugin does not support sections it might be more appropriate to say that it is based on the .properties format, used in many Java applications.
The following example shows basic usage of the mini
plugin.
`` <h1>Mount mini plugin to
user/tests/mini` sudo kdb mount mini.ini user/tests/mini mini
kdb set user/tests/mini/key value #> Create a new key user/tests/mini/key with string "value" kdb set user/tests/mini/mi/mi/mr beaker #> Create a new key user/tests/mini/mi/mi/mr with string "beaker"
kdb export user/tests/mini mini #> key=value #> mi/mi/mr=beaker
echo "๐ = ๐ฆ" >> kdb file user/tests/mini
echo "level1/level2 = ๐พ" >> kdb file user/tests/mini
user/tests/mini
contains four key value pairskdb ls user/tests/mini #> user/tests/mini/key #> user/tests/mini/level1/level2 #> user/tests/mini/mi/mi/mr #> user/tests/mini/๐
user/tests/mini/๐
contains the correct valuekdb get "user/tests/mini/๐" #> ๐ฆ
kdb rm -r user/tests/mini sudo kdb umount user/tests/mini
sudo kdb mount mini.ini user/tests/mini mini
kdb set user/tests/mini/key ';#=\' #> Create a new key user/tests/mini/key with string ";#=\"
kdb file user/tests/mini | xargs cat #> key=\;#\=\
kdb get user/tests/mini/key #> ;#=\
;
and #
characters, then theyecho 'background = #0F0F0F ; Background color' >> kdb file user/tests/mini
echo 'foreground = #FFFFFF # Foreground color' >> kdb file user/tests/mini
kdb get user/tests/mini/background #> #0F0F0F kdb get user/tests/mini/foreground #> #FFFFFF
kdb rm -r user/tests/mini sudo kdb umount user/tests/mini
sudo kdb mount mini.ini user/tests/mini mini
echo '[section]' >> kdb file user/tests/mini
printf 'key="multi\nline"' >> kdb file user/tests/mini
key
, sincekdb ls user/tests/mini 2> stderr.txt #> user/tests/mini/key
cat stderr.txt | grep -oE 'Line [[:digit:]]+.*' | sed 's/^[[:space:]]*//' #> Line 1: '[section]' is not a valid key value pair #> Line 3: 'line"' is not a valid key value pair
ini
and ni
plugin, mINI does not support metadata.kdb lsmeta user/tests/mini
key
also contains the double quote symbol, since mINI doeskdb get user/tests/mini/key #> "multi
rm stderr.txt kdb rm -r user/tests/mini sudo kdb umount user/tests/mini ```