Last active
November 18, 2018 17:21
-
-
Save vuonghv/a71eb60227d75ffcd2f6b732122c25a1 to your computer and use it in GitHub Desktop.
Simple Key-Value Store
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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