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变量中

posted @ 2019-10-29 11:15  爱打盹的猫猫  阅读(124)  评论(0编辑  收藏  举报