Elektra  0.8.26
Plugin: shell

The shell plugin executes shell commandos after set, get or error.

The configuration keys

are used to store the shell commands.

The configuration keys

can be compared against the return values of the shell commandos.

Example

1 # Create temporary file
2 kdb set system/tests/tempfile $(mktemp)
3 
4 # Mount plugin and specify plugin configuration
5 sudo kdb mount shell.ini system/tests/shell ini array= shell execute/set="echo set >> $(kdb get system/tests/tempfile)"
6 
7 cat $(kdb get system/tests/tempfile)
8 #>
9 
10 # Execute `set` command
11 kdb set system/tests/shell
12 #> Create a new key system/tests/shell with null value
13 
14 cat $(kdb get system/tests/tempfile)
15 #> set
16 
17 # Undo modifications
18 rm $(kdb get system/tests/tempfile)
19 kdb rm -r system/tests/shell
20 sudo kdb umount system/tests/shell