On 8/4/06, Denzil Kruse <[EMAIL PROTECTED]> wrote:
I want to see the results of a top command through my
web browser, but when I try this with my cgi script:

my $output = `top`;
print $output;

I get this error:

top: Unknown terminal "VT100" in $TERM

Is there a way to tell top which "terminal" i'm using?
 Or just get it to take a snapshot of the server and
return it back as a string?

top has *lots* of options, two that you could use to capture the
output as a string are -b (for batch mode) and -n 1 (for one
iteration)

It would not help you to set the terminal type because you would then
have to parse the escape sequences top uses for highlighting, etc.

Have a look at man top for more information.

Mike

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to