For some critical task, you just can’t wait for user response forever. If the user do not respond to input after certain period of time, you will use the default value and carry on the process. The bash command
read have such capability to support that.
A simple example to illustrate how it works
answer="yes";read -p "Are you sure you wanna install now? " -t 10 answer;echo " Your answer is $answer";
-t is to specified seconds to wait, if user do not respond in 10 seconds, the next command will be carry on.