4

I want to execute a python script X times with the same arguments in parallel, but I don't know how to accomplish this with GNU parallel.

Essentially what I'm trying to do is the equivalent of

parallel 'python3 script.py' ::: file1 file1 file1 ... file1

without having to manually type the filename X times

1 Answers1

2

I'm not sure it's the right way to do it, but you could generate N dummy arguments (using seq for example) and then tell parallel to read but not insert them using -N0 (making the real argument part of the command string).

Ex. for N = 5:

$ seq 1 5 | parallel --dryrun -N0  python3 script.py file1 :::
python3 script.py file1 
python3 script.py file1 
python3 script.py file1 
python3 script.py file1 
python3 script.py file1 
steeldriver
  • 143,099