IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 3, 2010, 10:57:10 AM (16 years ago)
Author:
rhenders
Message:

Can now work from a list or a single job ID

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/scripts/getExpIdFromJob.pl

    r27801 r27844  
    99my $path = undef;
    1010my $list = undef;
     11my $job = undef;
    1112
    1213GetOptions(
    1314        'path|p=s' => \$path,
    1415        'list|l=s' => \$list,
     16        'job|j=s' => \$job,
    1517        ) or pod2usage( 2 );
    1618
     
    2123        "--path <pathToJobsDir>\n".
    2224        "--list <listOfJobNames>\n\n",
     25        "--job <job>\n\n",
    2326        -exitval => 3
    2427        ) unless
    2528defined $path and
    26 defined $list;
     29(defined $list || defined $job);
    2730
    28 my $job;
    29 open (LIST, "$list") || die "couldn't open the file at '$list'";
     31if (defined $job) {getExpId($job);}
     32else {
    3033
    31 while ($job = <LIST>) {
     34    open (LIST, "$list") || die "couldn't open the file at '$list'";
     35
     36    while ($job = <LIST>) {
     37
     38        getExpId($job);
     39
     40    }
     41
     42close(LIST);
     43}
     44#################################################################
     45#
     46#
     47#################################################################
     48sub getExpId {
     49    my ($job) = @_;
    3250
    3351    chomp($job);
     
    4563
    4664    }
    47 
    4865}
    4966
    50 close(LIST);
    51 
    52 
    53 
Note: See TracChangeset for help on using the changeset viewer.