linode creation based on image bash parallel script loop?

Hello, I am a Linux newb looking to run the command below, but I want it to execute them all in parallel rather than in series, one by one. Any help would be appreciated.

!/bin/bash

for label in ubnt{1..200}; do linode create --location Newark --imageid 2791715 --plan linode1024 --label ${label}; done

Thanks!

1 Reply

This sounds like a job for job control

for label in ubnt{1..200}
do 
    linode create --location Newark --imageid 2791715 --plan linode1024 --label ${label} &
done

Using & backgrounds a command leaving the foreground attached to the parent process in this case returning control to the loop.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct