BASH - Timed Input - Show countdown
<p>I have a bash script that asks the user for their details.</p>

<p>I'm setting a limit to how long we wait for the input. I've found this and it appears to what I want.</p>

<pre><code>timelimit=5
echo -e " You have $timelimit seconds\n Enter your name quickly: \c"
name=""
read -t $timelimit name
#read -t $timelimit name &lt;&amp;1 
# for bash versions bellow 3.x
if [ ! -z "$name" ]
then
echo -e "\n Your name is $name"
else
echo -e "\n TIME OUT\n You failed to enter your name"
fi 
</code></pre>

<p>It shows "You have 5 seconds..." any way to update the output so it shows 4,3,2,1 etc as it counts down ?</p>

<p>Thanks</p>