I am trying to optimize a for loop to download files from a website based in a file with SPECIES names and their corresponding numbers of ACCESSION.
I want the loop to work first with the first species and the first accession number of the each file and so on... I tried the basic rule but it is not working.
#!/bin/sh
#Load modules
module load sra-toolkit/2.10.7-centos_linux64
Automatized download and assembly of transcritomes. SRA accession and species code required as arguments for the script
WORKSPACE=/vto
WORKSPACEFINAL=/vto
SPECIES=${WORKSPACE}/species_names.txt
ACCESSION=$accession_numers.txt
for i in $SPECIES
for j in $ACCESION
do
mkdir $SPECIES
cd $SPECIES
#SRA download and processing.
prefetch $ACCESSION
fastq-dump --defline-seq '@$sn[_$rn]/$ri' --split-files ${WORKSPACEFINAL}/ncbi/public/sra/${ACCESSION}.sra -O ${ACCESSION}
done
question from:
https://stackoverflow.com/questions/65942404/bash-loop-using-two-input-files-as-lists 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…