文章目录

read

基本用法

​ 选项:

-p:指定读取值时的提示符;

-t:指定读取值时等待的时间(秒)。

参数:

变量:指定读取值的变量名

案例

提示3s,读取控制台输入的名称

#!/bin/bash
read -t 3 -p "please enter your name in 3 s "  NAME
echo $NAME