专注各种脚本编程
Baidu
加入收藏夹
本站内容有下面分类知识,欢迎您的到来^_^
shell相关:指令篇 基础篇 脚本欣赏 编程实例 shell问问 shell视频教程 技巧篇 水平测试 E文资料 vi编辑器 高级Bash脚本编程指南
其他:mysql perl c语言 oracle
当前位置:| 主页>shell脚本欣赏>

一个定时弹出提示窗口的shell脚本

百度收藏 QQ搜藏
代码:
[/home/javalee/myshell]cat hello
#!/bin/ksh
#脚本名:hello
#描述:定时提醒用户是否该休息啦.....:-}
#作者:javalee
#日期:2003/9/20
function _time {
n=1
while ((n<600))
do
        sleep 1
        ((n+=1))
done
}

while true
do
_time
info="$USERNAME\n你该休息休息啦~~ :) "
tishi="提示信息"
xdialog --title $tishi --beep --msgbox $info 10 10
xdialog --title $tishi --no-buttons --beep --inputbox "休息吗[y/n]?" 4 20 2>tmp$$
input=$(cat tmp$$)
case $input in
        y)      break ;;
        n)      continue;;
        *)      xdialog --title $tishi --no-buttons --infobox "错误的选择!" 4 20;continue;;
        esac
rm tmp$$
done
上一篇:一个比较两个文件的脚本 下一篇:一个用mplayer听音乐的简单脚本

power by soyo123 2007-2008