Hello guys. Can you please help out?
I have a directory with multiple sub-directories that contain bam files. I try to count the number of reads for the different bam files recursively and generate count files with the unique bam file names using the command below:
for i in */*bam; do bedtools multicov -bams $i /data/reference/bedfiles/bed1.bed > /data/results/test/${i}; done
I get:
-bash: /data/results/test/sample1/sample1.txt: No such file or directory
-bash: /data/results/test/sample1/sample2.txt: No such file or directory
...
What am I missing?
Your help is appreciated
Thanks, Shawn. It works.