J
Jesse Cary
I am making a script that issues commands, pulls certain text from the
results and puts that text into an HTML table. I got the first two
columns to display fine and used my method as a template to fill the
third column, but I get the error stated in the subject line.
Below is the code and the text I am pulling the date from;
#CODE#
# STORE THE NAMES OF ALL THE VOBS #
@VOBS = `cleartool lsvob -s | sort`;
if ( $#VOBS == -1 )
{
printf ("INFO: No MultiSited VOBs - exiting\n");
exit 0;
}
###################################
# GET THE SPACE INFO FOR EACH VOB # this part is working fine...
###################################
foreach $VOB_NAME (@VOBS)
{
chomp ($VOB_NAME);
$VOB_SPACE{$VOB_NAME} = `cleartool space \ $VOB_NAME`;
# EXTRACT ONLY THE SPACE USED IN MB FROM THE SPACE COMMAND #
if ( $VOB_SPACE{$VOB_NAME} =~ /(\d+?\.\d)\s+?\d+?%\s+?Subtotal/ )
{
$VOB_SPACE{$VOB_NAME} = $1;
}
# IF NO INFO AVAILABLE FOR A VOB PRINT "N/A" FOR NOT AVAILABLE #
else {
$VOB_SPACE{$VOB_NAME} = "N/A";
}
}
#########################################
# GET THE DESCRIPTION INFO FOR EACH VOB #
#########################################
foreach $VOB_NAME (@VOBS)
{
#chomp ($VOB_NAME);
$VOB_DSCR{$VOB_NAME} = `cleartool describe -l vob:$VOB_NAME`;
# EXTRACTING CREATION DATE #
if ( $VOB_DSCR{$VOB_NAME} =~ /created\s(\d\d-\w{3}-\d\d)/ )
{
$VOB_DATE{$VOB_NAME} = $1;
}
}
##### THIS IS WHAT I'M PULLING THE DATE FROM #########
versioned object base "\VPPSHAREsrc"
created 16-Apr-03.14:16:58 by ustr-vp-bld.Domain Users@USTR-CMMGEN
master replica: CPG_COMMS@\VPPSHAREsrc
replica name: CPG_COMMS
VOB family feature level: 3
VOB storage hostathname
"ustr-cpgcc:d:\ClearCase_Storage\VOBs\VPPSHAREsrc.vbs"
VOB storage global pathname
"\\ustr-cpgcc\ccstg_d\VOBs\VPPSHAREsrc.vbs"
database schema version: 54
VOB ownership:
owner NA\USTR-VP-bld
group NA\Domain Users
Attributes:
FeatureLevel = 3
Hyperlinks:
AdminVOB@40@\VPPSHAREsrc -> vob:\COMMS
###################### BACK TO THE CODE BELOW ##############
################# OPEN HTML FILE VDS.html ###################
open(HTMLDOC, ">VDS.html") or die "Can't open VDS.html";
select(HTMLDOC);
printf("<html><head><title>VOB Status Page</title></head><body> \n");
printf("<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\"> \n");
printf("<tr><td><b>VOB
Name</b></td><td><b>MBytes</b></td><td><b>Date</b></td></tr> \n");
foreach $VOB_NAME (@VOBS)
{
chomp ($VOB_NAME);
printf("<tr><td>$VOB_NAME</td><td>$VOB_SPACE{$VOB_NAME}</td><td>$VOB_DATE{VOB_NAME}</td></tr>
\n");
}
printf("</table></body></html> \n");
close(HTMLDOC);
################## DONE WITH HTML PORTION #####################
print STDOUT "\n ALL DONE! VDS.html has been updated \n";
results and puts that text into an HTML table. I got the first two
columns to display fine and used my method as a template to fill the
third column, but I get the error stated in the subject line.
Below is the code and the text I am pulling the date from;
#CODE#
# STORE THE NAMES OF ALL THE VOBS #
@VOBS = `cleartool lsvob -s | sort`;
if ( $#VOBS == -1 )
{
printf ("INFO: No MultiSited VOBs - exiting\n");
exit 0;
}
###################################
# GET THE SPACE INFO FOR EACH VOB # this part is working fine...
###################################
foreach $VOB_NAME (@VOBS)
{
chomp ($VOB_NAME);
$VOB_SPACE{$VOB_NAME} = `cleartool space \ $VOB_NAME`;
# EXTRACT ONLY THE SPACE USED IN MB FROM THE SPACE COMMAND #
if ( $VOB_SPACE{$VOB_NAME} =~ /(\d+?\.\d)\s+?\d+?%\s+?Subtotal/ )
{
$VOB_SPACE{$VOB_NAME} = $1;
}
# IF NO INFO AVAILABLE FOR A VOB PRINT "N/A" FOR NOT AVAILABLE #
else {
$VOB_SPACE{$VOB_NAME} = "N/A";
}
}
#########################################
# GET THE DESCRIPTION INFO FOR EACH VOB #
#########################################
foreach $VOB_NAME (@VOBS)
{
#chomp ($VOB_NAME);
$VOB_DSCR{$VOB_NAME} = `cleartool describe -l vob:$VOB_NAME`;
# EXTRACTING CREATION DATE #
if ( $VOB_DSCR{$VOB_NAME} =~ /created\s(\d\d-\w{3}-\d\d)/ )
{
$VOB_DATE{$VOB_NAME} = $1;
}
}
##### THIS IS WHAT I'M PULLING THE DATE FROM #########
versioned object base "\VPPSHAREsrc"
created 16-Apr-03.14:16:58 by ustr-vp-bld.Domain Users@USTR-CMMGEN
master replica: CPG_COMMS@\VPPSHAREsrc
replica name: CPG_COMMS
VOB family feature level: 3
VOB storage hostathname
"ustr-cpgcc:d:\ClearCase_Storage\VOBs\VPPSHAREsrc.vbs"
VOB storage global pathname
"\\ustr-cpgcc\ccstg_d\VOBs\VPPSHAREsrc.vbs"
database schema version: 54
VOB ownership:
owner NA\USTR-VP-bld
group NA\Domain Users
Attributes:
FeatureLevel = 3
Hyperlinks:
AdminVOB@40@\VPPSHAREsrc -> vob:\COMMS
###################### BACK TO THE CODE BELOW ##############
################# OPEN HTML FILE VDS.html ###################
open(HTMLDOC, ">VDS.html") or die "Can't open VDS.html";
select(HTMLDOC);
printf("<html><head><title>VOB Status Page</title></head><body> \n");
printf("<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\"> \n");
printf("<tr><td><b>VOB
Name</b></td><td><b>MBytes</b></td><td><b>Date</b></td></tr> \n");
foreach $VOB_NAME (@VOBS)
{
chomp ($VOB_NAME);
printf("<tr><td>$VOB_NAME</td><td>$VOB_SPACE{$VOB_NAME}</td><td>$VOB_DATE{VOB_NAME}</td></tr>
\n");
}
printf("</table></body></html> \n");
close(HTMLDOC);
################## DONE WITH HTML PORTION #####################
print STDOUT "\n ALL DONE! VDS.html has been updated \n";