1、首先创建一个.sh脚本:touch read.sh
2、对脚本进行编写:vim read.sh
3、具体内容:
#!/bin/bash
read -t 9 -p "enter you want in 9 seconds" DATA
echo $DATA
4、其中-t是指输入限定时间,-p是指输入的指示符
5、执行:
bash ./read.sh
1、首先创建一个.sh脚本:touch read.sh
2、对脚本进行编写:vim read.sh
3、具体内容:
#!/bin/bash
read -t 9 -p "enter you want in 9 seconds" DATA
echo $DATA
4、其中-t是指输入限定时间,-p是指输入的指示符
5、执行:
bash ./read.sh