001、
[root@pc1 test]# ls a.fa [root@pc1 test]# cat a.fa ## 测试fasta文件 >chr1 aatt cc >chr2 ttgg ccgg >chr3 aa [root@pc1 test]# awk '{if($0 ~ /^>/) {print chr, sum; chr = $0; sum = 0} else {sum += length($0)}} END {print chr, sum}' a.fa >chr1 6 >chr2 8 >chr3 2
标签:shell,scaffold,pc1,fa,chr,linux,test,root,sum From: https://www.cnblogs.com/liujiaxin2018/p/16834372.html