#!/usr/bin/perl use CGI; use strict; my $req = new CGI; my $lines = $req->url_param( 'lines' ); my $grep = $req->url_param( 'grep' ); my $cut = $req->url_param( 'cut' ); $lines = 10 unless $lines; $grep = '.' unless $grep; $cut = '43-' unless $cut; my %hosts = ( 'b0' => 'stan', 'b1' => 'kenny', 'b2' => 'cartman', 'b3' => 'kyle', 'b4' => 'chef', 'b5' => 'jimmy', 'b6' => 'timmy' ); print "Content-type: text/html\n\n"; print <
|
$host
DOC print `cut -c $cut $log | egrep $grep | tail -n $lines`; print < |
DOC
}
print <
HTML