RE: [lug-nuts] Simple shelll script question

From: Scott Tyson (tysons@deepwell.com)
Date: Wed Jan 05 2000 - 21:32:28 PST


I found it I found it.... :)

#!/bin/sh
time=120
while true
  do
    ./somecommand
     sleep time
 done

This script should wait for the command to complete and when it does
sleep X seconds then run the command again.

*********** REPLY SEPARATOR ***********

On 1/5/00 at 4:51 PM Marc Matteo scribbled:

>Would an entry in /etc/inittab work?
>
>I don't know how you'd handle that X second delay, but inittab might
handle
>it somehow.
>
>Marc
>
>Marc Matteo
>Technical Leader, sacbee.com
>http://www.sacbee.com
>
>> ----------
>> From: Scott Tyson
>> Reply To: lug-nuts@saclug.org
>> Sent: Wednesday, January 5, 2000 4:44 PM
>> To: lug-nuts@saclug.org
>> Subject: [lug-nuts] Simple shelll script question
>>
>> I'm not much of a shell programmer. I can do this in perl but I
need to
>> do it in bash. What I need is script that will launch a program
then
>> wait for that program to terminate and when it does wait X seconds
then
>> restart the program. So the script itself would run all the time
making
>> sure the program runs all the time.
>>
>> Something like this:
>>
>> #!/bin/bash
>> cd dirName
>> TOP
>> ./programName
>> wait X
>> goto TOP
>>
>> How would I do this with bash?
>>
>> Scott
>>
>>
************************************************************************
**
>> **
>> * To UNSUBSCRIBE from the list, send a message with "unsubscribe
lug-nuts"
>> * in the message body to majordomo@saclug.org. Please direct other
>> * questions, comments, or problems to lug-nuts-owner@saclug.org.
>>
>>
>
>***********************************************************************
*****
>* To UNSUBSCRIBE from the list, send a message with "unsubscribe
lug-nuts"
>* in the message body to majordomo@saclug.org. Please direct other
>* questions, comments, or problems to lug-nuts-owner@saclug.org.

RaEl
Deepwell Gaming Server admin
quakeadmin@deepwell.com ICQ#: 125581
http://rand.deepwell.com/

****************************************************************************
* To UNSUBSCRIBE from the list, send a message with "unsubscribe lug-nuts"
* in the message body to majordomo@saclug.org. Please direct other
* questions, comments, or problems to lug-nuts-owner@saclug.org.



This archive was generated by hypermail 2b29 : Fri Feb 25 2000 - 14:29:09 PST