[BusyBox] read-command without timout?

Jens Nixdorf jens.nixdorf.liste at embesso.com
Wed Feb 18 13:47:40 UTC 2004


Hi All,

i have a problem with the read-command in busybox (1.0 pre7). I want to 
have an option for interrupting the startup-sequence for my system. For 
this i want to use the read-command, par example in this way:

#!/bin/bash
echo "1: action 1"
echo "2: action 2"
read -t 25 YOURCHOICE
if [ "$YOURCHOICE" = "1" ]; then
     echo "starting action 1"
elif [ "$YOURCHOICE" = "2" ]; then
     echo "starting action 2"
else
     echo "timeout reached"
fi

If the timeout is reached, the standard startup sequence will go on, if 
someone pressed any key, another script should be started. This script 
is working fine in bash 2.0x.

But it seems, that read has no switch "-t" for timeout in busybox, so it 
will be ignored and the systems is blocked in the line with the 
read-command. Some kind of "infinite waiting".

Is there any other possibility to have a non-blocking sequence like above?

many thanks, Jens



More information about the busybox mailing list