UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 17th, 2005, 05:39 AM
ihsan.mohamied ihsan.mohamied is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 9 ihsan.mohamied User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 16 m 17 sec
Reputation Power: 0
time command in ksh shell script

Dear all

I have a utility that runs from the ksh forum and would like it to be terminated once the duration of the program exceeds ten minutes. I know that this should be implemented in a while or until loop but how do I implement the clock or time functions. Thanks for your help.

ihsan.mohamied

Reply With Quote
  #2  
Old August 17th, 2005, 12:32 PM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,308 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 4 h 55 m 17 sec
Reputation Power: 48
try coprocesses:
Code:
#!/bin/ksh
# add this line at the start of your main shell script
async_coprocess.ksh $$ |&
..........


asynch_coprocess.ksh:
Code:
#!/bin/ksh
sleep 6000
kill -9 $1
exit 0

Reply With Quote
  #3  
Old August 18th, 2005, 05:51 AM
ihsan.mohamied ihsan.mohamied is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 9 ihsan.mohamied User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 16 m 17 sec
Reputation Power: 0
Thank you for your help. I got what I wanted.

Ihsan

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > time command in ksh shell script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway