shell 计时获取输入
#!/bin/bash
if read -t 5 -p "please enter your name:" namethen echo "hello $name ,welcome to my script"else echo "sorry,too slow"fiexit 0输出
please enter your name:xsxsxs
hello xsxsxs ,welcome to my script
#!/bin/bash
if read -t 5 -p "please enter your name:" namethen echo "hello $name ,welcome to my script"else echo "sorry,too slow"fiexit 0输出
please enter your name:xsxsxs
hello xsxsxs ,welcome to my script