perl脚本并发多条命令

perl脚本并发多条命令,第1张

概述#!/usr/bin/perl -w use strict; use Parallel::ForkManager; my $MAX_PROCESSES = 100; my $pm = new Parallel::ForkManager($MAX_PROCESSES); my @exp = ( ["expect /opt/agentc/temp/204064023_61_10.224.239.22_

#!/usr/bin/perl -w
use strict;
use Parallel::ForkManager;

my $MAX_PROCESSES = 100;

my $pm = new Parallel::ForkManager($MAX_PROCESSES);

my @exp = (
["expect /opt/agentc/temp/204064023_61_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_61_10.224.239.22_10.224.239.15   204064023_61_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_62_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_62_10.224.239.22_10.224.239.15   204064023_62_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_63_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_63_10.224.239.22_10.224.239.15   204064023_63_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_64_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_64_10.224.239.22_10.224.239.15   204064023_64_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_65_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_65_10.224.239.22_10.224.239.15   204064023_65_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_66_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_66_10.224.239.22_10.224.239.15   204064023_66_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_67_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_67_10.224.239.22_10.224.239.15   204064023_67_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_68_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_68_10.224.239.22_10.224.239.15   204064023_68_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_69_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_69_10.224.239.22_10.224.239.15   204064023_69_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_70_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_70_10.224.239.22_10.224.239.15   204064023_70_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_7_10.224.239.22_10.224.239.15.exp   /opt/agentc  /opt/agentc/temp/204064023_7_10.224.239.22_10.224.239.15    204064023_7_10.224.239.22_10.224.239.15.txt "],
["expect /opt/agentc/temp/204064023_71_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_71_10.224.239.22_10.224.239.15   204064023_71_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_72_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_72_10.224.239.22_10.224.239.15   204064023_72_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_73_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_73_10.224.239.22_10.224.239.15   204064023_73_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_74_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_74_10.224.239.22_10.224.239.15   204064023_74_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_75_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_75_10.224.239.22_10.224.239.15   204064023_75_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_76_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_76_10.224.239.22_10.224.239.15   204064023_76_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_77_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_77_10.224.239.22_10.224.239.15   204064023_77_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_78_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_78_10.224.239.22_10.224.239.15   204064023_78_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_79_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_79_10.224.239.22_10.224.239.15   204064023_79_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_80_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_80_10.224.239.22_10.224.239.15   204064023_80_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_8_10.224.239.22_10.224.239.15.exp   /opt/agentc  /opt/agentc/temp/204064023_8_10.224.239.22_10.224.239.15    204064023_8_10.224.239.22_10.224.239.15.txt "],
["expect /opt/agentc/temp/204064023_81_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_81_10.224.239.22_10.224.239.15   204064023_81_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_82_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_82_10.224.239.22_10.224.239.15   204064023_82_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_83_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_83_10.224.239.22_10.224.239.15   204064023_83_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_84_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_84_10.224.239.22_10.224.239.15   204064023_84_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_85_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_85_10.224.239.22_10.224.239.15   204064023_85_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_86_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_86_10.224.239.22_10.224.239.15   204064023_86_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_87_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_87_10.224.239.22_10.224.239.15   204064023_87_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_88_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_88_10.224.239.22_10.224.239.15   204064023_88_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_89_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_89_10.224.239.22_10.224.239.15   204064023_89_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_90_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_90_10.224.239.22_10.224.239.15   204064023_90_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_9_10.224.239.22_10.224.239.15.exp   /opt/agentc  /opt/agentc/temp/204064023_9_10.224.239.22_10.224.239.15    204064023_9_10.224.239.22_10.224.239.15.txt "],
["expect /opt/agentc/temp/204064023_91_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_91_10.224.239.22_10.224.239.15   204064023_91_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_92_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_92_10.224.239.22_10.224.239.15   204064023_92_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_93_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_93_10.224.239.22_10.224.239.15   204064023_93_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_94_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_94_10.224.239.22_10.224.239.15   204064023_94_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_95_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_95_10.224.239.22_10.224.239.15   204064023_95_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_96_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_96_10.224.239.22_10.224.239.15   204064023_96_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_97_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_97_10.224.239.22_10.224.239.15   204064023_97_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_98_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_98_10.224.239.22_10.224.239.15   204064023_98_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_99_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_99_10.224.239.22_10.224.239.15   204064023_99_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204185217_0_10.224.239.22_10.224.239.15.exp   /opt/agentc  /opt/agentc/temp/204185217_0_10.224.239.22_10.224.239.15    204185217_0_10.224.239.22_10.224.239.15.txt "],
["expect /opt/agentc/temp/204064023_6_10.224.239.22_10.224.239.15.exp   /opt/agentc  /opt/agentc/temp/204064023_6_10.224.239.22_10.224.239.15    204064023_6_10.224.239.22_10.224.239.15.txt "],
["expect /opt/agentc/temp/204064023_61_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_61_10.224.239.22_10.224.239.15   204064023_61_10.224.239.22_10.224.239.15.txt"],
["expect /opt/agentc/temp/204064023_66_10.224.239.22_10.224.239.15.exp  /opt/agentc  /opt/agentc/temp/204064023_66_10.224.239.22_10.224.239.15   204064023_66_10.224.239.22_10.224.239.15.txt"]
);

foreach my $i (@exp) {
#print "@$i---"."\n";
  $pm->start and next;
  `@$i`;   $pm->finish; } #$pm->wait_all_children;

总结

以上是内存溢出为你收集整理的perl脚本并发多条命令全部内容,希望文章能够帮你解决perl脚本并发多条命令所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1293560.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-10
下一篇 2022-06-10

发表评论

登录后才能评论

评论列表(0条)

保存