Skip to content

Instantly share code, notes, and snippets.

@hryniuk
Last active June 19, 2017 11:30
Show Gist options
  • Save hryniuk/be4539e67cc41cc08f150cb03c2b0d29 to your computer and use it in GitHub Desktop.
Save hryniuk/be4539e67cc41cc08f150cb03c2b0d29 to your computer and use it in GitHub Desktop.
Simple BASH database
#!/bin/bash
# copied from https://jvns.ca/blog/2017/06/11/log-structured-storage/
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