I want to execute the commands in a loop at the same time, not one after another

Posted by Felipe Alvarez on Super User See other posts from Super User or by Felipe Alvarez
Published on 2010-05-17T08:25:19Z Indexed on 2010/05/17 8:31 UTC
Read the original article Hit count: 320

Filed under:
|

I'd like to write a loop ('for') that will do some action 'X' number of times. But instead of performing the actions sequentially, one after another, I'd like them to execute simultaneously (in parellel at the same time). How can this be achieved? Script or a one liner are fine.

example ONLY:

for i in 1 2 3 4 5; do dd if=/dev/zero of=/tmp/disk$i bs=10M count=10; done

© Super User or respective owner

Related posts about scripting

Related posts about bash