Hi, I tried to make a parser to display some information in labels widgets
written in Perl TK.
My file is cygwin_syslog.txt and my code is:
my ($f)=@_;
$thistime=(stat($f))[9];
return if ($thistime == $mtime);
$mtime=$thistime;
my $dummy;
unless (open (FILE, $f))
{
warn "Couldn't open file $f: $!";
return;
}
@lines=<FILE>;
close (FILE);
($dummy, $IP_address, $read,
$status)=split(":",$lines[$#lines-1]);
$ethernet_address=~/from\s+(.*)\s+via/;
$IP_address=~s/^\s*(.*)\s*$/$1/;
($client_name)=split(/\./,$IP_address);
$read=~/.*bootp(.*)\s*/;
$boot_file=$1;
$read=~/.*(\/bootp.*)\s*/;
$install_file_path=$1;
I wanted to display in the label $ethernet_address what is betwwen from and via
in my file ie: 52:41:53:20:b0:c0:d0:69:49:34:c1:01:01:00:00:00 in this case.
in $IP_address I wanted to display: cabs41.col.bsf.alcatel.fr ie wha is
betwwen the 2 :
$read I wanted to display : cygwin.bat ie what comes after bootp
$install_file_path : /bootp/cygwin.bat ie what comes after for .
My code didn't worked why?How can I do?
dhcpd : LOG_INFO : Internet Software Consortium DHCP Server 2.0
dhcpd : LOG_INFO : Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software
Consortium.
dhcpd : LOG_INFO : All rights reserved.
dhcpd : LOG_INFO :
dhcpd : LOG_INFO : Please contribute if you find this software useful.
dhcpd : LOG_INFO : For info, please visit http://www.isc.org/dhcp-contrib.html
dhcpd : LOG_INFO :
dhcpd : LOG_INFO : Listening on Socket/eth0/155.132.0.0
dhcpd : LOG_INFO : Sending on Socket/eth0/155.132.0.0
dhcpd : LOG_INFO : DHCPDISCOVER from 52:41:53:20:c0:f6:c8:35:6c:80:c0:01:01:00:00:00
via eth0
dhcpd : LOG_ERR : Booting denied, no alcatel XID and the vendor class is empty
dhcpd : LOG_INFO : DHCPDISCOVER from 52:41:53:20:b0:c0:d0:69:49:34:c1:01:01:00:00:00
via eth0
dhcpd : LOG_ERR : Booting denied, no alcatel XID and the vendor class is empty
LOG_INFO : cabs41.col.bsf.alcatel.fr: read request for /bootp/cygwin.bat: success.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]