Hello,
does anyone know how to disable interpretaion of special characters in a script ?
I would like to get a script that breaks whenever I press any key of the keyboard, for say during 5 seconds.
I have the following script.
Code:
i=5
while [ $i -ge 0 ]; do
tput cub1
echo -n "$i"
read -n1 -t 1 keypressed <&1
if [ ! -z "$keypressed" ]; then
echo "stop"
break
fi
let $[ i -= 1 ]
done
It is ok when I press alphanumeric keys, but it doesn't work for keys like "tab" key or "ctrl" key.
Any help will be very appreciated.
Thanks, xround