I have this little bash script with a while loop, that waits for user input, does something and then sleeps for a while:
while true; do
read input
echo $input
sleep 5
done
I don't want it to accept any user input during sleep. The problem is that any input entered in the shell during sleep is processed when the script continues. Is it possible to completely disable user input during the sleep period?
I've seen this: Disabling user input during an infinite loop in bash, but that doesn't really help me here, does it?
Hope someone can help me with this.