I have a file input.txt
with three columns
A B Z
C D Y
E F X
I want to read the first two fields, perform some function and name the output with the last field.
while IFS=" " read -r f1 f2 f3; do cat $f1 $f2 > $f3; done < file.txt
How can I apply this to longer codes
the input.sample.text
has following three columns
../Data/G20P1sc-C05-R1.fastq.gz ../Data/G20P1sc-C05-R1.fastq.gz G20P1sc-C05
../Data/G20P1sc-C08-R1.fastq.gz ../Data/G20P1sc-C08-R1.fastq.gz G20P1sc-C08
while IFS=" " read -r f1 f2 f3; do rsem-calculate-expression --star --star-path /share/pkg/star/2.7.0e/bin --temporary-folder --star-gzipped-read-file --paired-end $f1 $f2 ../genome_indices/rsem-star/rsem-star ../test_results/$f3; done < src_pdm3012/input.sample.text
The output has the following error
EXITING: FATAL INPUT ERROR: empty value for parameter "outFileNamePrefix" in input "Command-Line-Initial"
SOLUTION: use non-empty value for this parameter
I try to explicitly use the --outFileNamePrefix
and it still has the same error
while IFS=" " read -r f1 f2 f3; do rsem-calculate-expression --star --star-path /share/pkg/star/2.7.0e/bin --temporary-folder --star-gzipped-read-file --paired-end $f1 $f2 ../genome_indices/rsem-star/rsem-star --outFileNamePrefix $f3; done < ../src_pdm3012/input.sample.text
while IFS=" " read -r f1 f2 f3; do rsem-calculate-expression --star --star-path /share/pkg/star/2.7.0e/bin --temporary-folder --star-gzipped-read-file --paired-end $f1 $f2 ../genome_indices/rsem-star/rsem-star --outFileNamePrefix $f3; done < ../src_pdm3012/input.sample.text
But it does not work