#!/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 < GBUILD :: Log :: gbuild.org

HTML foreach my $n ( sort( keys( %hosts ) ) ) { my $host = $hosts{$n}; my $log = "/home/j2eetck/agent-logs/$n.log"; print < DOC } print <
HTML
GBUILD :: Logs :: gbuild.org
$host
DOC

print `cut -c $cut $log | egrep $grep | tail -n $lines`;

print <