There are two things, the number of tries and the running clock. The -t option of the read internal command takes care of the timout while the shell wait for the user input. But you have to implement a general timer that will start as soon as the script starts. For that, use the date function converted in number of seconds since
EPOCH. That's the idea. Try this: Code: #!/bin/bash...