Guest User

Untitled

a guest
Jul 18th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1.  
  2. use strict;
  3. use warnings;
  4.  
  5. use File::Tail;
  6.  
  7. my $i = 0;
  8. my $log = $ARGV[0];
  9. my $logfile = File::Tail->new(name=>$log, maxinterval=>3, adjustafter=>3, interval=>0, tail=>100);
  10.  
  11. while(defined(my $line=$logfile->read) && $j < $j+1) {
  12. $i++;
  13. if (0 == $i % 2) {
  14. print "\033[31m", $line, "\033[0m";
  15. }
  16. else {
  17. print $line;
  18. }
  19. }
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. if (@ARGV==0) {
  30. print "$0: missing file operand\n";
  31. print "Try '$0 --help' for more information.\n";
  32. }
  33.  
  34. if ($ARGV[0] =~ "--help") {
  35. help();
  36. }
  37.  
  38. sub help {
  39. print "-h\t\tshow this help\n";
  40. }
Add Comment
Please, Sign In to add comment