How to convert a DBM file to Plaintext.

Struggled to find this on the net, so Posting here for my personal Referance and in case its ever removed. (and those that google I suppose)


Source

Quite simple really.

Take this code: SCRIPT SOURCE

And paste it into a file on your Linux Box (you will need PERL and other packages installed to run it, nothing particulary different)

Lets assume that your new script's filename is called 'dbm' and the filename.db you are trying to read/edit/play with is called 'foo'.

Some of the Commands:
$ dbm foo init
To set a key value pair:
$ dbm foo set key1 val1 
To set several key value pairs at once:
$ dbm foo set key1 val1 key2 val2
To delete a key value pair:
$ dbm foo delete key
To delete several key value pairs at once:
$ dbm foo delete key1 key2 key3
To list all key value pairs:
$ dbm foo list
To list selected key value pairs:
$ dbm foo list key1 key2 key3
To edit all key value pairs with your favourite editor (as determined by $EDITOR or $VISUAL):
$ dbm foo edit
To clear all key value pairs from the file:
$ dbm foo clear everything yes really







Thats it!


If this helped you, dont thank me, thank the Author of this script.

Comments

Popular Posts