Skip to content

Instantly share code, notes, and snippets.

@vuonghv
Last active November 18, 2018 17:21
Show Gist options
  • Save vuonghv/a71eb60227d75ffcd2f6b732122c25a1 to your computer and use it in GitHub Desktop.
Save vuonghv/a71eb60227d75ffcd2f6b732122c25a1 to your computer and use it in GitHub Desktop.
Simple Key-Value Store
#!/bin/bash
db_set() {
echo "$1:$2" >> database
}
db_get() {
grep "$1:" database | sed -e "s/^$1://" | tail -n 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment