ITPub博客

首页 > Linux操作系统 > Linux操作系统 > linux shell 交互, read 命令

linux shell 交互, read 命令

原创 Linux操作系统 作者:G8bao7 时间:2015-12-14 12:06:50 0 删除 编辑
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/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-11-04

  • 博文量
    496
  • 访问量
    1258282