Changeset 1894 for trunk/server/common/oursrc/logview
- Timestamp:
- Jun 11, 2011, 12:03:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/common/oursrc/logview/logview.pl
r1890 r1894 1 1 #!/usr/bin/perl -T -w 2 2 3 %ENV = ();4 $ENV{'PATH'} = '/bin:/usr/bin';5 3 my $elogsrc = '/home/logview/error_log'; 6 4 # get by uid the caller's name to find the corresponding locker name 7 my $caller = (getpwuid $<)[0];8 $\ = "\n";5 my ($caller, $home) = (getpwuid($<))[0, 7]; 6 my $search = "$home/"; 9 7 10 print "--- Error logs for $caller --- ";11 open FOO, $elogsrc;8 print "--- Error logs for $caller ---\n"; 9 open FOO, '<', $elogsrc or die $!; 12 10 while (<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; 18 12 }
Note: See TracChangeset
for help on using the changeset viewer.