Home
PHP
Tech Tube
MySQL
Linux
CSS&HTML
JavaScript

Loop until date

The following code will loop until a given date is reached:
#!/bin/sh
enddate=$(date -d "2016-06-20 14:18:00" +%s)
while [ $(date +%s) -lt $enddate ]; do
        sleep 1
        // Do something...
done