你认识perl中的` `吗?
时间:2009-01-08 来源:无泪的等待
#!/usr/bin/perl
$count = 0;
$report = "ture";
$status = '/proc/partitions';
open(STATUSINFO, $status) or die("can not open /proc/partitions!");
@status_list =<STATUSINFO>;
close(STATUSINFO);
foreach $line (@status_list)
{
if($line =~ /\s*\d+\s+\d+\s+\d+\s*(sd)\w+\s*/)
{
$count ++;
}
}
print "count numbers of system_disk: ".$count."\n";
if($count > 24)
{
$report = "false";
}
print "the system_status is: ".$report."\n\n"; ----------------------------------------------------------------------------------- #!/usr/bin/perl @report_info = `/b_iscsi/bin/report_disk_numbers_status.pl`;
if(@report_info[1] =~ /false/)
{
exit 1;
}
$report = "ture";
$status = '/proc/partitions';
open(STATUSINFO, $status) or die("can not open /proc/partitions!");
@status_list =<STATUSINFO>;
close(STATUSINFO);
foreach $line (@status_list)
{
if($line =~ /\s*\d+\s+\d+\s+\d+\s*(sd)\w+\s*/)
{
$count ++;
}
}
print "count numbers of system_disk: ".$count."\n";
if($count > 24)
{
$report = "false";
}
print "the system_status is: ".$report."\n\n"; ----------------------------------------------------------------------------------- #!/usr/bin/perl @report_info = `/b_iscsi/bin/report_disk_numbers_status.pl`;
if(@report_info[1] =~ /false/)
{
exit 1;
}
相关阅读 更多 +