read -p "Continue ?(y/n), Please input in 5 seconds " -t 5 -n 1 input
input=`echo "$input" | tr "[:upper:]" "[:lower:]" `
echo -e "\nYour input is '$input'"
if [ "y"x = "$input"x ]; then
sn=5
echo "after $sn seconds will do "
for((i=$sn;i>0;i--));do echo $i; sleep 1;done
# dorun
else
echo "exit"
fi
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26250550/viewspace-1871839/
,如需转载,请注明出处,否则将追究法律责任。