0

I want to run multiple bash scripts in parallel.

example of my script running : ./test1.sh $1 and ./test2.sh $1

I tried this: parallel ::: "~/path/test1.sh $1" "~/path/test2.sh $1"

Not working properly, any idea how to fix this?

0

1 Answer 1

0

You could use xargs:
echo "~/path/test1.sh $1 ~/path/test2.sh $1" | xargs -P0 -n2 /bin/bash

-P0 says "run all in parallel"
-n2 passes two arguments to /bin/bash, in this case the script and the parameter

Sign up to request clarification or add additional context in comments.

3 Comments

It's showing ~/path/test1.sh no such file or directory.
you need to put the path to your script
Given the correct path.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.