[shell] 循环判断输入值

做个记录

until [[ $flag == "yes" || $flag == "exit" ]]
do
    read -p "请确认统一/合服前后数据是否一致,输入yes继续执行脚本,输入exit退出:" flag
    if [[ $flag = "yes" ]]; then
        break
    elif [[ $flag = "exit" ]];then
        exit
    else
        continue
    fi
done

 

posted @ 2014-10-14 17:55  金枪语  阅读(446)  评论(0编辑  收藏  举报