在向SGE提交Perl生成的脚本时捕获作业ID

ajw*_*ood 1 perl qsub sungridengine

Perl无法打开同时运行和运行的命令管道,这会在通过qsub提交到SGE时导致问题,因为我丢失了提交的作业ID.如何将生成的脚本提交给SGE 捕获SGE分配的作业ID?

mob*_*mob 5

这是一个Perl常见问题解答:如何在命令之间打开管道?(简答:见IPC::Open2)

另一种方法是使用shell中的I/O重定向工具来捕获外部程序的输出:

open my $qsub_proc, '|-', "qsub $command $args > some/file";
print {$qsub_proc} $the_input_to_the_command;
close $qsub_proc;

open my $qsub_fh, '<', 'some/file';
my @qsub_output = <$qsub_fh>;
... # now parse @qsub_output to get your job id
Run Code Online (Sandbox Code Playgroud)