I have a bash loop where I am passing variables to a script. I want to run these in parallel with GNU parallel
for FILE_NAME in FILE1 FILE2 FILE3;
do
./SCRIPT -n $FILE_NAME
done
where I want the scripts to run in parallel as follows:
./SCRIPT -n FILE1
./SCRIPT -n FILE2
./SCRIPT -n FILE3
I am trying to use the GNU parallel command because it has been suggested a lot on here, but I am confused about where to put the parallel command if I am passing a variable to the script.
I have tried turning the FILE1 FILE2 FILE3
into a list:
parallel -a $FILE_LIST ./SCRIPT -n $FILE_NAME
for FILE_NAME in FILE1 FILE2 FILE3;
do
parallel ./SCRIPT -n $FILE_NAME
done
Do you have any suggestions?