Pretty n00ber question I am sure, but I can't seem to figure out exactly what this snip of code does, if someone doesn't mind breaking it down for me:
sleep $(( $(date --date="$at" +%s) - $(date +%s) ));
In very general terms the script `sleeps` for the duration in minutes, $at, the user sets before an alarm sounds. I ripped it from another script some time ago that I am now using with great success in an alarm script I hacked together.
The script is quite useful for my purposes and I use it many times a day. But my problem is that whenever I set an alarm that will extend into the next day (past midnight) the alarm simply goes off immediately, and I think it has to be this snip I need to understand better to modify so it allows alarms to extend past midnight.
If it would help to see it in context I could paste the rest of my alarm script.