I have a script that I've cobbled together to copy fastq from each sample within a project into one folder on my computer.
This works, except for the occasions that I have to resequence a particular sample. Only the original sample is copied because basemount put " (2)" on the sample folder name for the second run. How can I tweak this so it will copy the fastq for the second run (the fastq are unique because they all get the run info as part of the name). I think I need to change this so the second part of the cp command ignores the " (2)" but can't figure out how. My first thought was to remove the * but that made it fail for all samples, not just the duplicates.
Rereading the bash documentation isn't helping http://tldp.org/LDP/abs/html/string-manipulation.html
Code:
for f in ../basemountpoint/basespace/Projects/PROJECTNAME/Samples/*/Files/*.gz; do cp $f PROJECTNAME"/fastq/"${f##*Files/}; done
Rereading the bash documentation isn't helping http://tldp.org/LDP/abs/html/string-manipulation.html
Comment