I some directories that contain a similarly named file eg (*Sample_name*.base.coverage.txt). And I would like to paste all of the *base.coverage.txt files together. I have something written, but its not quite right as I don't think I am actually pasting them together.
cd /g/bo/vir/analysis find -type d | while read dir; do if [ -f $dir/*.base.coverage.txt ]; then paste $dir/*.base.coverage.txt >> paste_all_l30.p90.base.cov.norm fi done
I am also thinking of a different loop method, but I am unsure how to get the list of directories into an array.
for x in $dir; do cat /$x/*.base.coverage.txt;done > paste_all_l30.p90.base.cov.norm
Any help? thanks