Created
December 16, 2017 05:22
-
-
Save superdaigo/da73772841c1e1f207985e61c596af22 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/bash | |
STOP_AT=$(date -j -v "+1H" "+%H:%M") | |
if [ ! -z $1 ] && [[ $1 =~ ^[0-9]{1,2}:[0-9]{2}$ ]] ; then | |
STOP_AT="${1}" | |
if [ ${#1} -eq 4 ] ; then | |
STOP_AT="0${1}" | |
fi | |
fi | |
echo "Will stop at ${STOP_AT}" | |
while : | |
do | |
MS=$(date "+%M%S") | |
TIME=$(date "+%H:%M") | |
if [ ${MS:1:3} -eq "000" ] ; then | |
say -v Kyoko "${TIME} になりました" | |
fi | |
if [ ${TIME} = ${STOP_AT} ] ; then | |
exit | |
fi | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment