Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Calculate sleep time' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Calculate sleep time
Authored by: googoo on May 16, '07 09:03:56AM
You could also calculate the sleep time using date and a little math.

#!/bin/sh
while : ; do
    open /path/to/getpic.app
    sleepTime=$((`date +%S`%15))
    sleep $sleepTime
done

This would repeat every 15 seconds forever.

-Mark



[ Reply to This | # ]
Calculate sleep time--Correction
Authored by: googoo on May 16, '07 05:14:56PM
OK. I did not check my code. This version will work.

#!/bin/sh
while : ; do
    open /path/to/getpic.app
    sleepTime=$((15-`date +%S`%15))
    sleep $sleepTime
done

-Mark



[ Reply to This | # ]