INTERVAL=5
timeout_read()
{
timeout=$1
varname=$2
old_tty_setting=`stty -g` #这句话是什么意思?
stty -icanon min 0 time ${timeout}0 # stty -icanon 是什么意思?
eval read $varname #eval 是干嘛的?
stty "$old_tty_setting" #stty又是干什么的?
}
echo;echo -n "What's your name? Quick!"
timeout_read 3 your_name
echo
if [ ! -z "$your_name" ]
then
echo "Your name is $your_name"
else
echo "Time out"
fi
echo
exit 0
