There is date in my file, like 30-apr-2015. How can I compare this with the current date and get notified if they are equal?
1 Answer
This code does the comparison and informs you by printing a message on the console where you typed the command:
[[ $(date +%Y%m%d -d $(< file)) == $(date +%Y%m%d) ]] && echo "wake up"
You may want to replace the echo
by any other command that notifies you, e.g., use the command mail
.