hai, i want to make a time out if user entered input after a delay second,please help me with the below script
~~~~~~~~~~~~~~~~~~~~~~~
TIME_OUT=3
echo -e " \t Command Line Test "
echo "1.Sign in "
echo "2.Sign up "
echo "3.Exit "
echo " NOTE: if you donot select options,this window will be automatically closed in $TIME_OUT seconds "
read -t "$TIME_OUT" -p "Please choose above options :" OPTION
while [ "$OPTION" != 1 -a "$OPTION" != 2 -a "$OPTION" != 3 ] ; do
read -t $TIME_OUT -p " Error! Please choose correct availabe options :" OPTION
done
case $OPTION in
1)sign_in ;;
2)sign_up ;;
3)exit ;;
esac
In that above case if user didn't enter option , it is not exiting script whereas it goes to next read.please help me with this issue.
~~~~~~~~~~~~~~~~~~~~~~~
TIME_OUT=3
echo -e " \t Command Line Test "
echo "1.Sign in "
echo "2.Sign up "
echo "3.Exit "
echo " NOTE: if you donot select options,this window will be automatically closed in $TIME_OUT seconds "
read -t "$TIME_OUT" -p "Please choose above options :" OPTION
while [ "$OPTION" != 1 -a "$OPTION" != 2 -a "$OPTION" != 3 ] ; do
read -t $TIME_OUT -p " Error! Please choose correct availabe options :" OPTION
done
case $OPTION in
1)sign_in ;;
2)sign_up ;;
3)exit ;;
esac
In that above case if user didn't enter option , it is not exiting script whereas it goes to next read.please help me with this issue.