-
-
Save isomorphisms/04d9045eb1a7470573f8 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 | |
shopt -s expand_aliases | |
alias log='tee -a productivity.log; date >> productivity.log' | |
finished() | |
{ | |
echo -e "\n\nDone!" | log | |
exit $? | |
} | |
trap finished SIGINT | |
interrupt() | |
{ | |
echo -e "\n\nSomething went wrong." | log | |
exit $? | |
} | |
trap interrupt SIGKILL SIGTERM | |
#main program | |
echo -e "Begin $1.\n\n" | log | |
for minute in {1..15} | |
do | |
echo -n $minute | |
for seconds in {1..12} | |
do | |
sleep 5 | |
echo -n ' .' | |
done | |
echo -e "\n" | |
done | |
echo $1 >> productivity.log | |
echo "You went over time, bozo." | log | |
unalias log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment