in reply to killing command if it takes too much time
I did this a few years ago in: Timing and timing out Unix commands.