今天写的一个perl脚本需要调用samtools view,在系统bashrc中,使用简写view表示samtools view,

然后再perl中使用简写,脚本如下:

#!/usr/bin/perl
use strict;
use 5.010;
my $datadir = shift;
my @bamfiles = glob "$datadir/*.bam";
for my $bamfile (@bamfiles) {
        my $total = `view -c $bamfile`;
        say $total;
}
运行时,提示:

Vim: Warning: Output is not to a terminal

(光标)

然后卡住不动,纳闷,将view改回全写samtools view

结果输出:

28400342
(空行)
25923609
(空行)
25497987
(空行)

这是为什么呢?

posted on 2015-09-16 10:09  Namlike  阅读(410)  评论(0编辑  收藏  举报