perl在一个bash脚本中结合perl一个衬里​​和脚本

时间:2018-04-24 13:39:45

标签: bash perl

marcmoose-lint unimarc.rules marc.iso
perl -ne 'if (/^([0-9]{3})[()0-9]*: *(.*)$/) { print "$1: $2\n";}' marc.iso.log | sort | uniq -c
perl script1.pl
perl script2.pl filename.txt
perl script3.pl

我试过以下,没有运气: wrapper.pl脚本:

my $command = "perl s1.pl in.fa > out1.txt";
system($command);

$command = "perl s2.pl out1.txt > out2.txt";
system($command);

$command = "perl s3.pl out2.txt > out3.txt";
system($command);

我怎样才能制作上述所有剧本

marcmoose-lint unimarc.rules marc.iso
    perl -ne 'if (/^([0-9]{3})[()0-9]*: *(.*)$/) { print "$1: $2\n";}' marc.iso.log | sort | uniq -c
    perl script1.pl
    perl script2.pl filename.txt
    perl script3.pl

插入单个可执行脚本,即run.sh?

1 个答案:

答案 0 :(得分:1)

use autodie qw( system );

system(q{marcmoose-lint unimarc.rules marc.iso});
system(q{perl -ne 'if (/^([0-9]{3})[()0-9]*: *(.*)$/) { print "$1: $2\n";}' marc.iso.log | sort | uniq -c});
system(q{perl script1.pl});
system(q{perl script2.pl filename.txt});
system(q{perl script3.pl});