5 use FindBin qw
/$Script $RealScript/;
7 my ($user_id,$script,$maxloop,$loopsleep,$help);
18 \tperl $Script <-s <shell_script>> [Options]
21 \t-s shell_script at the end of your 'qsub' commend, should be absolutepath
22 \t-m the max loop time when fail to check the shell's job [3]
23 \t-t the sleep time [s] when loop [10]
24 \t-h show this help\n" if($help || !$script);
26 chomp($user_id = `whoami`) unless($user_id);
29 #$script = abs_path($script);
31 for (my $i=0;$i<$maxloop;$i++){
32 my @job_id = `qstat -u $user_id | grep ' r ' | grep '^[0-9][0-9]' | awk '{print \$1}'`;
36 my $status = `qstat -j $_ 2>&1 | grep -E 'job_number|script_file|usage'`;
37 if ($status =~ /script_file.+$script/){
38 print STDERR
"\n".$status."\n";
45 die "Cannot check the job of $script!\n";