Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15177422
  • 博文数量: 7460
  • 博客积分: 10434
  • 博客等级: 上将
  • 技术积分: 78178
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-02 22:54
文章分类

全部博文(7460)

文章存档

2011年(1)

2009年(669)

2008年(6790)

分类:

2008-05-03 10:45:01

代码:
[/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
阅读(2588) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~