Problem with busybox' read-command

Feb 18, 2004 0 Replies

Hi All,



i have a problem with the read-command in busybox (1.0 pre7). Normally my embedded system will run directly into a kiosk-mode X-Session, but I want to have an option for interrupting the startup-sequence for maintenance. 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 at my workstation.



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?



thanks, Jens


Die obige Adresse ist OK, wird aber nicht gelesen. Für Mails an mich bitte "usenet" gegen "jens.nixdorf" austauschen.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required