Closed SimonMorvan closed 6 years ago
It's a matter of shell variable. Since _
is a legal character in shell variable, $i_
is different from $i
+ _
. You need use {
and }
for disambiguation, i.e., use ${i}_
.
seqtk sample -s100 SF_S${i}_R1.fastq 25 > R1_sub$i.fastq ;
Thanks for your quick response, it works fine now :)
@SimonMorvan can you close this issue please?
yes!
Hello, I'm trying to subsample my fastq files with the seqtk sample function. My files are named SF_Sx_R1.fastq and SF_Sx_R2.fastq, x being a number. I've tried this loop: _for i in {1..10} ; do ./seqtk sample -s100 SF_S$i_R1.fastq 25 > R1_sub$i.fastq ; ./seqtk sample -s100 SF_S$i_R2.fastq 25 > R2sub$i.fastq ; done but it only creates empty fastq files. However, when I do _./seqtk sample -s100 SF_S1_R1.fastq 25 > R1sub1.fastq it works fine...
What am I doing wrong?