Hello Joost,

I suppose, that you are talking about Bash scripts.

If so, you may put each individual command in a subshell by using an ampersand ("&") at the end of the line.

This example[1] shows it nicely.

-Ramon

[1] 3. Parallelize running commands by grabbing PIDs.: https://will-keleher.com/posts/5-Useful-Bash-Patterns.html

On 14/03/2022 11:13, J. Roeleveld wrote:
Hi,

I often put multiple commands into a single file/script to be run in sequence.
(each line can be executed individually, there is no dependency)

Is there a tool/method to execute multiple lines/commands simultaneously? Like
having 3 or 4 run together and when 1 is finished, it will grab the next one in
the list?

I would prefer this over simply splitting the file as the different lines/
commands will not take the same amount of time.

Thanks,

Joost




--
GPG public key: 5983 98DA 5F4D A464 38FD CF87 155B E264 13E6 99BF

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to