#!/usr/bin/perl
$hist_file_name=$ARGV[0];
print "$hist_file_name\n";
open (H_F,$hist_file_name)|| die "file $hist_file_name not found";
$i=1;
while ($hl1=)
{
chop $hl1;
if ($hl1=~/^#/)
{
$hl1=~s/\#//g;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($hl1);
$date_time=sprintf ("%i-%02i-%02i %02i:%02i:%02i",$year+1900,$mon,$mday,$hour,$min,$sec);
#print "$hl1\t$date_time\n";
$hl2=;
$output=sprintf ("% 5i \[%s\]%s",$i,$date_time,$hl2);
print $output;
}
$i++;
}
阅读(1066) | 评论(0) | 转发(0) |