Julio Capote's Blog - Feed · Oct 7, 2012
An Embedded Key/Value Store for Shell Scripts
0Sign in to vote or save
This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.
UPDATE: this is now available as a sub command, here: kiev Cooked this up last night when I needed a simple key/value store for use in a shell script: #!/bin/sh DBFILE = example.db put (){ echo "export kv_ $1 = $2 " >> $DBFILE } del (){ echo "unset kv_ $1 " >> $DBFILE } get (){ source $DBFILE eval r = \$ $( echo "kv_ $1 " ) echo $r } list (){ source $DBFILE for i in $( env | grep "kv_" | cut -d =…
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.