#!/bin/bash
for i in $(seq $1)
do
echo -n '.'
sleep 1
done
echo
The script prints a dot per second and the number of dots on the screen depending on user's input. What I want to do is that when I press a key (for example, a), the script will run faster like one dot in half a second..so the more I press the same key, the faster it runs.