#!/usr/bin/perl -w # # showscript: Display the script associated with a job. # Copyright 2006 Ohio Supercomputer Center # Revision info: # $HeadURL$ # $Revision$ # $Date$ # # Usage: showscript [options] JOBID # # Options: # -c Show all of the output file ("cat", default) # -h Show only the beginning of the output file ("head") # -p dir Use dir as PBS spool directory # -t Show only the end of the output file ("tail") # -# Show only # lines of output # -? Display help $tool="cat"; $numlines=""; $suffix="SC"; while ( $ARGV[0] =~ /^-.*/ ) { if ( $ARGV[0] eq "-c" ) { $tool="cat"; } elsif ( $ARGV[0] eq "-h" ) { $tool="head"; } elsif ( $ARGV[0] eq "-p" ) { $ENV{"PBS_HOME"}=$ARGV[1]; shift(@ARGV); } elsif ( $ARGV[0] eq "-t" ) { $tool="tail"; } elsif ( $ARGV[0] =~ /^-[0-9]+$/ ) { $numlines=$ARGV[0]; } elsif ( $ARGV[0] eq "-?" || $ARGV[0] eq "-help" ) { print STDERR <