I have two files in my current folder (MA502) whose names are -
MA502_TAAGGCGA-TCGCAGG_L001_R1_001.at.fastq
MA502_TAAGGCGA-TCGCAGG_L001_R2_001.at.fastq
I have many such folders - ex MA503, MA504 etc, and I want to loop over those.
I assign my variable names using wild cards -
Forward=*R1*.at.fastq
Reverse=*R2*.at.fastq
I want to process these files in a script, and I want my output to replace .at
to .atqt
, so that the final name would look like -
MA502_TAAGGCGA-TCGCAGG_L001_R1_001.atqt.fastq
MA502_TAAGGCGA-TCGCAGG_L001_R2_001.atqt.fastq
I tried
awk 'script' $Forward > ${Forward/.at/.atqt}
My final file name looks like -
*R1*.atqt.fastq
instead of my expectation which was
MA502_TAAGGCGA-TCGCAGG_L001_R1_001.atqt.fastq
I've learnt everything by necessity on unix, so I'm not sure how variable names are processed. Any help is appreciated!