eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0; #;-*- Perl -*- ################################################################################################### # This script gets a jobid and checks if the jobs is "running","waiting in queue", or "stopped". ################################################################################################### if(@ARGV < 1) {die "In check.pl, need to provide jobid.\n";} $jobID=$ARGV[0]; chomp($line=`qstat | grep $jobID | tail -1`); $line=~s/^\s+//; @line=split(/\s+/,$line); if(!$line[4]){ $jobStatus="stopped"; }elsif(lc($line[4]) eq 'r'){ $jobStatus="running"; }else{ $jobStatus="queue"; } print "$jobStatus\n";