by havoc [ posted: 11.Apr.2006 12:11 PM ] [dura-link][Print]
Set up a
while loop that tests the time (with
date), and repeat until test fails.
Example:
I want to play an internet stream, restarting automatically if the stream gets interrupted, until 2:00 pm.
while (( `date +%H` < 14 )); do mplayer "http://www.url.com/path/to/stream"; done
`date +%H` executes a shell, returning the current hour only.
< 14 will compare the returned number to '14'
while ... do ...; done is your loop structure.