I want to run one software that takes three inputs. When I am running analysis on the cluster I can use Slurm to get each column as input for a job array.
samplesheet="test.txt"
name=`sed -n "$SLURM_ARRAY_TASK_ID"p $samplesheet | awk '{print $1}'`
foward=`sed -n "$SLURM_ARRAY_TASK_ID"p $samplesheet | awk '{print $2}'`
reverse=`sed -n "$SLURM_ARRAY_TASK_ID"p $samplesheet | awk '{print $3}'`
Then I can run the software with the command:
software --imput $foward $reverse --output $name
It works for a job array. I want to do something similar on my computer.
For example, I have a file:
sample001 file001a file001b
.
.
.
sample1000 file1000a file1000b
The first column will be the prefix of the output file and, columns 1 and 2 are two input files.
I have tried to use a loop or xargs, but it works for one column.
For example:
For example,
for line in test.txt
do
# do something with $line here
done
or
cat test.txt | while read line
do
# do something with $line here
done
How can I do this?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…