Shell实现控制台确认交互 发表于 2018-11-25 | 分类于 计算机 , Shell | | 123456789read -r -p "Are you sure? [y/N] " responsecase "$response" in [yY][eE][sS]|[yY]) do_something ;; *) do_something_else ;;esac 参考文档: https://stackoverflow.com/questions/3231804/in-bash-how-to-add-are-you-sure-y-n-to-any-command-or-alias Donate - Support to make this site better.捐助 - 支持我让我做得更好. 打赏 比特币(BTC/USDT) 以太坊(ETH/USDx) TRX(USDx)