Package: sudo
Version: 1.7.2p7-1

I am running the following bash code to give a default answer and wait
for five seconds for a user input (one key) to change the default:

----------
accion=x
tiempo=5
t=0

while [ $t -lt $tiempo ]
do
        echo -n .
        read -n 1 -s -t 1 orden

        if [ $orden ]; then
                accion=$orden
                t=$tiempo
        fi
        t=$[t+1]
done
echo -e "\nTecla presionada: $accion"
exit 0
----------

When run as a normal user, or as root, the behaviour is as expected, but
when I run it with sudo, the output is the following:

----------
Error message:
.read: 18: Illegal option -n
[: 18: Illegal number: $[t+1]
Tecla presionada: x
----------

I think that the output should be the same as the one obtained when
invoked by root (or a normal user in this case, since privileges are not
needed).

I use Debian Squeeze for an Intel 32 bits CPU, updated today.




-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to