Shell method for timing out an operation after a given number of seconds