I want to write a shell where given a date (day-hour-min) e.g.
10:00 AM Sun
2:30 PM Mon
...
It sleeps until that exact date & time. I thought one way of doing it is, I could get the current date and calculate the difference? then convert that into seconds and sleep for that time.
However, I am not too sure how you could do so using shell scripts?
#!/bin/bash
now=$(date '+%A %W %Y %X')
date = 2:30 PM Mon
difference = ??
sleep difference