I want to start 100 processes in bash
, but the for
statement doesn\'t seems to like the &
symbol and I\'m getting a syntax error,
With GNU Parallel you can do:
echo "Spawning 100 processes"
parallel -j0 ./my_script.py ::: {1..100}
Or to avoid the argument 1 through 100:
parallel -j0 -N0 ./my_script.py ::: {1..100}
Without -j0 it will spawn one process per CPU thread.
Watch the intro videos for more details: https://www.youtube.com/playlist?list=PL284C9FF2488BC6D1