How to use Bash read with a timeout?

后端 未结 3 470
不知归路
不知归路 2020-12-04 17:09

I can ask the user to press Enter by using read, and have him wait by calling sleep. But I can’t think of a way of doing both at the sam

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 18:11

    From the bash reference manual :

    read [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt][-t timeout][-u fd] [name ...]

提交回复
热议问题