"; local $tailcmd = $config{'tail_cmd'} || "tail -n LINES"; $tailcmd =~ s/LINES/$lines/g; if ($filter ne "") { # Are we supposed to filter anything? Then use grep. local @cats; if ($cmd) { push(@cats, $cmd); } elsif ($config{'compressed'}) { # All compressed versions foreach $l (&all_log_files($file)) { $c = &catter_command($l); push(@cats, $c) if ($c); } } else { # Just the one log @cats = ( "cat ".quotemeta($file) ); } $cat = "(".join(" ; ", @cats).")"; $got = &foreign_call("proc", "safe_process_exec", "$cat | grep -i $filter | $tailcmd", 0, 0, STDOUT, undef, 1, 0, undef, 1); } else { # Not filtering .. so cat the most recent non-empty file if ($cmd) { # Getting output from a command $fullcmd = $cmd." | ".$tailcmd; } elsif ($config{'compressed'}) { # Find the first non-empty file, newest first $catter = "cat ".quotemeta($file); if (!-s $file) { foreach $l (&all_log_files($file)) { next if (!-s $l); $c = &catter_command($l); if ($c) { $catter = $c; last; } } } $fullcmd = $catter." | ".$tailcmd; } else { # Just run tail on the file $fullcmd = $tailcmd." ".quotemeta($file); } $got = &foreign_call("proc", "safe_process_exec", $fullcmd, 0, 0, STDOUT, undef, 1, 0, undef, 1); } print "$text{'view_empty'}\n" if (!$got); print "