help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] parallel processing in bash (to replace for loop)


From: Peng Yu
Subject: Re: [Help-bash] parallel processing in bash (to replace for loop)
Date: Fri, 27 Jan 2012 11:13:37 -0600

On Fri, Jan 27, 2012 at 7:28 AM, Greg Wooledge <address@hidden> wrote:
> On Thu, Jan 26, 2012 at 09:57:59PM -0600, Peng Yu wrote:
>> I have see a number of ways to parallelize for loop. However, none of
>> the methods is syntactically clean and easy (as I would want, maybe
>> they are good enough for others) to use with bash. I'm wondering what
>> is the best practice to parallelize a for loop in bash as of now.
>
> for i in {1..5}; do
>  foobar "$i" &
> done
> wait
>
> See also http://mywiki.wooledge.org/ProcessManagement

This won't work if you have many foobar to run.

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]