Very simple Key-Value database on bash script. Depends on pre-installed software only (tested on Ubuntu 14.04 LTS):
- sed
- bash
- grep
- base64
- xargs
bpkg install reddec/bash-dbmake installgit clone https://github.com/reddec/bash-db
cd bash-db
chmod +x db.sh
cp db.sh /usr/local/bin/dbdb <method> <database> [arguments...]
Methods:
Insert or update record.
| Arg | Description |
|---|---|
key (required) |
Unique key. Can be used any value (also spaces if value in bracets) |
value (optional) |
Value of record. Can be used any value (also spaces if value in bracets). If value not set, STDIN will be used. |
db put test.db name 'Red Dec'Get value of record by key
| Arg | Description |
|---|---|
key (required) |
Unique key. Can be used any value (also spaces if value in bracets) |
db get test.db nameGet all keys in database
No arguments
db list test.dbGet the value of the last added record
No arguments
db last test.dbDelete record by key
| Arg | Description |
|---|---|
key (required) |
Unique key. Can be used any value (also spaces if value in bracets) |
db delete test.db name