Changeset 1894 for trunk/server/common


Ignore:
Timestamp:
Jun 11, 2011, 12:03:07 AM (11 years ago)
Author:
andersk
Message:
logview: Simplify, fix spurious newlines, get rid of sketchy regexes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/common/oursrc/logview/logview.pl

    r1890 r1894  
    11#!/usr/bin/perl -T -w
    22
    3 %ENV = ();
    4 $ENV{'PATH'} = '/bin:/usr/bin';
    53my $elogsrc = '/home/logview/error_log';
    64# get by uid the caller's name to find the corresponding locker name
    7 my $caller = (getpwuid $<)[0];
    8 $\ = "\n";
     5my ($caller, $home) = (getpwuid($<))[0, 7];
     6my $search = "$home/";
    97
    10 print "--- Error logs for $caller ---";
    11 open FOO, $elogsrc;
     8print "--- Error logs for $caller ---\n";
     9open FOO, '<', $elogsrc or die $!;
    1210while (<FOO>) {
    13     # Prevent deviousness, like web_scripts directories within web_scripts
    14     if (m(/afs/(?:athena|sipb).mit.edu/) &&
    15         m(/([^/]+)/web_scripts/) && $caller eq $1) {
    16         print;
    17     }
     11    print if index($_, $search) != -1;
    1812}
Note: See TracChangeset for help on using the changeset viewer.