for i in `cat /home/htvam/muthu/mbovis/uk_fastq/trim_files/sub_list.txt`
do
for j in `cat /home/htvam/muthu/mbovis/uk_fastq/trim_files/fn_pos.txt`
do
echo "$i\t\c"
echo "$j\t\c"
echo "$(samtools view "$i"_dup_mapped_sorted.bam NC_000962.3:$j-$j | awk '{if($2<1023) print}' | wc -l)\t\c"
echo "$(samtools view "$i"_dup_mapped_sorted.bam NC_000962.3:$j-$j | awk '{if($2>1023) print}' | wc -l)"
done
done
sub_list.txt contains
- ERR125598
- ERR125599
fn_pos.txt contains
- 14401
- 62049
- 71336
- 4386228
- 4394265
- 4395387
- 4395804
It output results like:
But I need the next sample “i” in a list should print the tab instead of newline like