2 # Log viewer program. Pass it parameters of the logs to view, or it will
3 # automatically view some.
10 my $logdir='/var/log';
13 # If I am root, look at all logs, otherwise only those that are
16 find(sub {my $fn = $_;
17 my $stat = stat($File::Find::name);
18 next if not defined $stat;
19 if (($fn =~ /\.log$/ or $fn =~ /^mail\.(?:err|warn)$/) and ($stat->mode & 0006 or $> == 0)) {
20 push @logfiles,$File::Find::name;
27 if (-e $ENV{HOME}."/.xsession-errors") {
28 push @logfiles, $ENV{HOME}."/.xsession-errors";
31 # Tail without wasting the last line of the screen.
32 open(TAIL, "tail -q --follow=name --retry -n 2 @logfiles|");