I have a txt file (say jobs.txt) that has several lines like:
"sbatch -w node00x script.sh 1"
"sbatch -w node00z script.sh 10"
.
.
etc
I wonder if it is possible to create an executable bash file like the following
#!/bin/bash
while read -r line;
do submit the job by line;
done < jobs.txt;
that I can just execute and which will run the jobs in respective nodes. I have very limited knowledge in this area. Would appreciate any help.
What I usually do in those cases is:
If you have set the execution permissions for that file (as its extension suggests), give them to it:
And if it is necessary, I would add to the head of the jobs.txt:
And if you want to remove any confusion with the file name, rename it:
Now, you have a workload ready to be submitted!