bash: nested while read & for file in - no output -


i have following file structure:

db/organism1.fasta db/organism1.fasta.nhr db/organism1.fasta.nin db/organism1.fasta.nsq db/organism2.fasta db/organism2.fasta.nhr db/organism2.fasta.nin db/organism2.fasta.nsq sequences/abc123.faa sequences/def456.faa numbers.txt 

numbers.txt

abc123 def456 

now want to

  1. read in each line of file numbers.txt - each number represents file in dir sequences
  2. take each *.fastafile dir db
  3. do (in case blast search of each db against sequences)
  4. output 1 file each line in numbers.txt

this attempt:

while read line    file in db/*.fasta       tblastn -db $file -query sequences/$line.faa -evalue 1e-10 -outfmt 7 >>$line_blastn.txt    done done<numbers.txt 

but no file being written. why?

$line_blastn treated one variable. since variable never assigned value, output file .txt. files starting dot hidden in linux , max os, therefore cannot see output file.

write ... >> "${line}_blastn.txt" use line variable.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -