Created
January 15, 2023 02:52
-
-
Save leannejdong/c5976b61da3921cefd013a6d1a6f7456 to your computer and use it in GitHub Desktop.
This file contains 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/zsh | |
# Author: leannejdong | |
# Usage: bill <add|list|remove> <name> <amount> <due_date> | |
BILL_FILE=~/.bills | |
case "$1" in | |
add) | |
echo "$2;$3;$4" >> $BILL_FILE | |
echo "Bill added: $2 - $3 - $4" | |
;; | |
list) | |
cat $BILL_FILE | |
;; | |
remove) | |
sed -i "/$2/d" $BILL_FILE | |
echo "Bill removed: $2" | |
;; | |
*) | |
echo "Invalid argument" | |
exit 1 | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment