majid
majid

Reputation: 723

execute bash script asynchronously multiple times?

I have this bash script

# a.sh

name="Hello"
echo $name

How can I execute multiple times a.sh asynchronously?

Upvotes: 1

Views: 1252

Answers (1)

John Bollinger
John Bollinger

Reputation: 180181

You can use a Bash range expansion and for loop to conveniently express the multiplicity, and the & operator to put the script executions in the background:

for x in {1..8}; do
    bash /path/to/a.sh &
done

Upvotes: 2

Related Questions