免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1420 | 回复: 9
打印 上一主题 下一主题

sleep 210 minutes, 系统会不会自动kill 掉着个PID啊? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-06-29 02:16 |只看该作者 |倒序浏览
在一个脚本A里,掉用了SLEEP 来等待210分钟
如下:
#/usr/bin/ksh!
count=0
while (test $count -lt 210)
do
count=`expr $count + 1 `
sleep 60
done

可是,为为什么A自动就没有了哪?

论坛徽章:
0
2 [报告]
发表于 2004-06-29 02:47 |只看该作者

sleep 210 minutes, 系统会不会自动kill 掉着个PID啊?

当进程结束后系统会调用exit函数来结束此进程!
ps:首行行尾多了个叹号

论坛徽章:
0
3 [报告]
发表于 2004-06-29 05:14 |只看该作者

sleep 210 minutes, 系统会不会自动kill 掉着个PID啊?

bjgilr, Thanks for your help.
Maybe I did not give a clarity description. Originally I want to implement the following function in the A shell :   a Simple flowchat:

        start
           |
         B command
           |
           | sleep 210 minutes
           |
        C command
           |
           | sleep 210
           |
         D command
           |
           | sleep 210
           |
        D end
           |
         Exit

But, in fact, after executed the B command , 210 minutes later, C command was not executed. why ?


Could you give me a good ideal to implement the about flowchat ? I don't want to use the "at command"

论坛徽章:
0
4 [报告]
发表于 2004-06-29 09:44 |只看该作者

sleep 210 minutes, 系统会不会自动kill 掉着个PID啊?

你写这么复杂干嘛?一条语句就搞定了。
sleep 12600
C段未执行,可能是其他原因引起的。再检查吧。

论坛徽章:
0
5 [报告]
发表于 2004-06-29 09:48 |只看该作者

sleep 210 minutes, 系统会不会自动kill 掉着个PID啊?


  1. for cmd in B C D;do
  2.     $cmd
  3.     sleep 210
  4. done
复制代码

论坛徽章:
0
6 [报告]
发表于 2004-06-29 10:31 |只看该作者

sleep 210 minutes, 系统会不会自动kill 掉着个PID啊?

heihei,俺不是新手么,就不知道怎么写,结果搞的复杂了.

俺说的B ,C ,D command,其实一组SHELL 脚本,
例如B COMMAND
{
E -para > 111.log
F 111.log >222.txt
}

这里E F 是俺自己写的一些其他EXPECT or Perl 写的脚本
bjgirl, 你说的那样,似乎不行啊?

论坛徽章:
0
7 [报告]
发表于 2004-06-29 10:38 |只看该作者

sleep 210 minutes, 系统会不会自动kill 掉着个PID啊?

210是秒咯

论坛徽章:
0
8 [报告]
发表于 2004-06-29 10:41 |只看该作者

sleep 210 minutes, 系统会不会自动kill 掉着个PID啊?

哈哈,行就是行,不行就是不行,计算机处理数据可没有似乎这么一说 再说,那不过是个例子,

论坛徽章:
0
9 [报告]
发表于 2004-06-29 11:12 |只看该作者

sleep 210 minutes, 系统会不会自动kill 掉着个PID啊?

#!/bin/sh
counter=0
until [ $counter = 210 ]
do
counter=`expr $counter +1`
sleep 60
done

论坛徽章:
0
10 [报告]
发表于 2004-06-29 21:24 |只看该作者

sleep 210 minutes, 系统会不会自动kill 掉着个PID啊?

谢谢bjgirl.谢谢楼上个位.
俺再来尝试下.看看
其他办法.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP