bash 提示用户输入 choice

read -p "Continue (y/n)?" choice
case "$choice" in 
  y|Y ) echo "yes";;
  n|N ) echo "no";;
  * ) echo "invalid";;
esac
posted @ 2017-03-18 20:15  zxyblog  阅读(250)  评论(0编辑  收藏  举报