I have a shell script that takes three arguments, which need to come from a single line of a text file.
Example text file:
1 1 2300000
1 2300001 5300000
1 5300001 7100000
1 7100001 9200000
1 9200001 12600000
I want to run the script once for each line:
sbatch script 1 1 2300000
sbatch script 1 2300001 5300000
... And so on
I'm trying to write code to include these three arguments for every line of the text file. So far, I've tried a few things, including:
while read x y z in text
do
./script $x $y $z
done
I've found similar questions on here but they don't quite answer my problem. I'm about ready to just submit each line manually, so any help or suggestions on how to do this would be greatly appreciated!
xargs -L 1 sbatch script <file