标签:root ash continue fine tin alt bash mil com
关键词:read -s
隐藏实质:read(-s选项,安静模式,输入的内容与背景同颜色)
脚本:
[root@test tansk]# cat test.sh #!/bin/bash read -n1 -p "Do you want to continue [Y/N]?" -s answer case $answer in Y | y ) echo "" echo "fine,continue on....";; N | n ) echo "" echo "ok,goodbye" exit;; esac
实现效果:
标签:root ash continue fine tin alt bash mil com
原文地址:https://www.cnblogs.com/tanshouke/p/12405588.html