Linux命令-read


[chenjl@ipha-dev71-1 yysoft]$ read -p "check run the script is the mysql server? (y/n) " choice check run the script is the mysql server? (y/n) y [chenjl@ipha-dev71-1 yysoft]$ echo $choice y

详细解释:

p是prompt的缩写,指提示信息

read -p "check run the script is the mysql server? (y/n) " choice

以上命令回车后会显示 check run the script is the mysql server? (y/n)

之后用户输入的内容会被保存到choice变量中

原文地址:https://www.cnblogs.com/wang-mengmeng/p/11757676.html