Skip to content

Instantly share code, notes, and snippets.

@leannejdong
Created January 15, 2023 02:52
Show Gist options
  • Save leannejdong/c5976b61da3921cefd013a6d1a6f7456 to your computer and use it in GitHub Desktop.
Save leannejdong/c5976b61da3921cefd013a6d1a6f7456 to your computer and use it in GitHub Desktop.
#!/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