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
- read in each line of file
numbers.txt- each number represents file in dirsequences - take each
*.fastafile dirdb - do (in case blast search of each db against sequences)
- 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
Post a Comment