I've the following problem; two directories that containing:
- dir1: a list of files like the following:
file1.fq file2.fq file3.fq
and so on..
- dir2: a lis of files like the following:
file1.fq.sa file2.fq.sa file3.fq.sa
what I have to do is running a command that uses file1.fq and file1.fq.sa together.
I've tried the following loop:
fq=dir1/*
sa=dir2/*
for fqfiles in $fq;
do
for sa_files in $sa;
do
mycommand ${sa_files} ${fqfiles} > ${sa_files}.cc &
done
done
The problem is that my loop execute the following:
mycommand file1.fq.sa file1.fq > file1.fq.sa.cc #correct
but also
mycommand file1.fq.sa file2.fq > file1.fq.sa.cc #wrong!
and so on...in a almost infinite loop!
I wish my loop could produces something like:
mycommand file1.fq.sa file1.fq > file1.fq.sa.cc
mycommand file2.fq.sa file2.fq > file2.fq.sa.cc
mycommand file3.fq.sa file3.fq > file3.fq.sa.cc
etc...
Could you please help me?
Thank you!
Fabio