I have a task that is very well inside of a bash for loop. The situation is though, that a few of the iterations seem to not terminate. What I'm looking for is a way to introduce a timeout that if that iteration of `command` hasn't terminated after e.g. two hours it will terminate, and move on to the next iteration.

Rough outline:

```
for somecondition; do
   while time-run(command) < 2h do
     continue command
   done
done

```