shell yes or no 选择的写法

2019-03-01  本文已影响0人  SkTj

!/bin/bash

read -n1 -p "Do you want to continue[Y/N]?" answer
case $answer in
Y | y) echo
echo "continue";;
N | n) echo
echo "goodbye"
exit;;
esac

上一篇 下一篇

猜你喜欢

热点阅读