Created
December 23, 2017 19:53
-
-
Save lae/d9a29633aeb2d02ed2e7f945ffd78fac 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 | |
read -p"How many alarms?" count | |
for c in $(seq 1 $count); do | |
read -p"What time are you setting alarm #${c} for? " date | |
echo "Okay, will ring you on $(date --date="$date")." | |
# Create a subshell and background it | |
( | |
sleep $(( $(date --date="$date" +%s) - $(date +%s) )); | |
echo 'Wake up!' #or whatever action you want to take | |
)& | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment