Shell實現等待用戶輸入並設定缺省執行

while true;do
stty -icanon min 0 time 100
echo -n "Automatic execute ten seconds after,Are you sure you want to start     the task(yes or no)?"
read Arg
case $Arg in
Y|y|YES|yes)
  break;;
N|n|NO|no)
  exit;;
"")  #Autocontinue
  break;;
esac
done
 
echo
echo "others function..."
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章