Shell实现等待用户输入并设定缺省执行
2010-09-18 19:00
274 查看
使用Shell实现提示用户是否继续操作并且当用户闲置时根据自定义时间缺省继续执行,代码如下:
while true;do stty -icanon min 0 time 100 echo -n "Automatic execute ten seconds after,Are you sure you want to start the task(yes or no)?" read Arg case $Arg in Y|y|YES|yes) break;; N|n|NO|no) exit;; "") #Autocontinue break;; esac done echo echo "others function..."
相关文章推荐
- until 循环:实现一个shell脚本,不停地询问用户要执行什么操作,直到用户输入quit才会退出
- c#如何实现一个线程暂停,等待用户输入文本后继续运行?
- Shell脚本中实现切换用户并执行命令操作
- 实现执行scp命令时不需要输入用户密码
- linux 普通用户登录后,执行 shell脚本切自动输入密码切换到root
- c#如何实现一个线程暂停,等待用户输入文本后继续运行?
- Shell脚本中实现切换用户并执行命令操作
- Shell脚本中实现切换用户并执行命令操作【转】
- SHELL实现跳板机,只允许用户执行少量允许的命令
- SHELL实现跳板机,只允许用户执行少量允许的命令
- shell练习:函数实现接受参数,查询用户输入的用户情况(带颜色显示)
- 自己实现一个SQL解析引擎 功能:将用户输入的SQL语句序列转换为一个可执行的操作序列,并返回查询的结果集。 SQL的解析引擎包括查询编译与查询优化和查询的运行,主要包括3个步骤: 查询分析
- 对用户输入的判断的shell实现代码
- Jquery 搜索等待用户输入完成时自动执行
- Linux(7) 常用命令扩展 改变用户环境变量 (可以实现登陆就执行shell脚本)
- 实现执行scp命令时不需要输入用户密码
- c#如何实现一个线程暂停,等待用户输入文本后继续运行?
- 实现执行scp命令时不需要输入用户密码
- jenkins 以root用户执行Shell脚本并不需要输入密码
- 对用户输入的判断的shell实现代码