Created
October 10, 2016 14:43
-
-
Save LadyNamedLaura/8218169c80937799272dee00362873c4 to your computer and use it in GitHub Desktop.
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 | |
MYDIR="${HOME}/.worklog" | |
mkdir -p "${MYDIR}" | |
cd "${MYDIR}" | |
LOGNAME="$(date '+%x').log" | |
touch "${LOGNAME}" | |
touch TODO | |
clear | |
cat "${LOGNAME}" | |
while read -p '> ' line | |
do | |
tput cuu1 | |
echo -ne "--${line}" | sed 's/./ /g' | |
echo -ne "\r" | |
case "${line}" in | |
TODO\ *|todo\ *|TODO:*|todo:*) | |
echo ${line} | sed 's/todo:\?\s*//i' > TODO | |
echo ${line} | |
;; | |
TODO|todo) | |
vim TODO | |
;; | |
quit|bye) | |
echo bye | |
exit 0 | |
;; | |
*) | |
echo "$(date '+%X'): ${line}" | tee -a "${LOGNAME}" | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment