View Single Post
Old 09-12-2019, 08:11 AM   #8
SNPsaurus
Registered Vendor
 
Location: Eugene, OR

Join Date: May 2013
Posts: 521
Default

You should do the entire command as Genomax listed (with a change, I think, I'll mention below):

for i in *.bam; do reformat.sh in=${i}.bam out=${i}.fa; done

The first part (for i in *.bam) finds all the files ending in .bam in the directory, then passes them to the "do" command. So you should change the command to the below which removes the .bam from the in= name, since $i should already have the .bam at the end.

for i in *.bam; do reformat.sh in=$i out=${i}.fa; done

The output file will be named something like
filename.bam.fa
__________________
Providing nextRAD genotyping and PacBio sequencing services. http://snpsaurus.com
SNPsaurus is offline   Reply With Quote