[sllug-members]: Command to Execute command continuously

Smith, Jeff Jeff.Smith at hollycorp.com
Wed Jun 21 12:32:59 MDT 2006


You might want to avoid calling the script from inside itself.  This can cause memory problems.  Each time the script launch it reloads the script into memory, but it won't release it until the script finishes which it won't because it just called itself.

I think the best solution would be the one line infinite while-loop that Jeff Schroeder mentioned.  You can even put an & at the end to move it to the background.

while true; do <command>; done &

jeff smith

________________________________________
From: sllug-members-bounces at sllug.org [mailto:sllug-members-bounces at sllug.org] On Behalf Of Randy Clements
Sent: Wednesday, June 21, 2006 12:28 AM
To: sllug-members at sllug.org
Subject: Re: [sllug-members]: Command to Execute command continuously

I just realized I could call the script itself at the end of the script.  And that seems to be working a bit.  However, is there a better way to do what I want to do??
On 6/21/06, Randy Clements <handyrandyrc at gmail.com> wrote:
I have a new DNS server I want to REALLY pound on.  I found a little pair of scripts on the Internet which allows you to do a bunch of lookups and then return results.

HOWEVER, I'd like to be able to run this command OVER and OVER and OVER again -- possibly getting it going MULTIPLE times on my machine in different shells. 

Anyone know how to do it?  Currently I do a ./check from the command like to run my script after I chmod 777'ed the file.  Works great.  But then I have to wait for the result, then run it again manually.

I want it to just run all flippin' night long -- is there a way to get it to run that continuously from the command line? 

______________________________________________________________________
See http://www.sllug.org/ for latest SLLUG news, information, links. 
Join SLLUG and other UT LUG members on irc.FreeNode.net channel #Utah
sllug-members at sllug.org
http://www.sllug.org/cgi-bin/mailman/listinfo/sllug-members 




More information about the sllug-members mailing list