perl的文件句柄不仅支持普通文件, 还支持管道,今天需要统计一个fastq文件中的序列数和碱基数,而NGS的fastq文件一般都是gzip压缩的,所以 需要读取压缩文件中的内容,代码如下: my ($fastq) = @ARGV: my ($reads, $bases) = cal_sequence_info($fastq); print qq{$reads\t$bases\n}; sub cal_sequence_info { my $fastq = shift; my $file_hand
Android开发过程中在sh,py,mk文件中添加log信息的方法 在sh文件中: echo "this is a log info" + $info 在py文件中: print ("this is a log info ",info) 在mk文件中 $(warning warning:'this is a log info')
shell脚本实现读取一个文件中的某一列,并进行循环处理 1) for循环 #!bin/bash if [ ! -f "userlist.txt" ]; then echo "userlist.txt 不存在!" fi for userid in `(cat userlist.txt)` do a=$userid echo $a done #!bin/bash if [ ! -f userlist.txt ]; then echo "userlist.tx