[svlug] Running a command n times simutaneously

Andrew Stitt a at t.armory.com
Tue Apr 25 11:37:45 PDT 2006


On Tue, Apr 25, 2006 at 11:12:10AM -0700, Joe Buck wrote:
> 
> On Tue, Apr 25, 2006 at 09:23:22AM -0700, Rufoo wrote:
> > > For a performance measurement task I need to run a
> > > command n>1 times simultaneously. Is there any tool
> > > that can help me do this? 
> 
> On Tue, Apr 25, 2006 at 10:58:13AM -0700, Andrew Stitt wrote:
> > You can use the '&' shell operator to run a command in the background
> > and use it in a loop to run the command in the background n times.
> 
> But that doesn't provide a clean way of timing when the processes have
> all completed.

Of course.

The question wasnt clear on whether or not the timing was important. He
could be interested in how something else performs while there are n
other things chewing away at system resources. He just asked how to run
n things simultaneously. *shrug*

In anycase, bash also has a wait builtin that will wait for everything
to finish, if that matters.

Obviously you can do this in almost any language you want.

-Andrew




More information about the svlug mailing list