On 08/04/2006 04:36 PM, Denzil Kruse 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" is not ideal for a one-time, text-only output run.
However, to do it anyway, you would probably set TERM to
"vt100" (notice the small case "vt"), and you'd tell top to
only iterate once:
$ENV{TERM} = "vt100";
my $output = `top -n 1`;
But why not just use ps?
Thanks,
Denzil
You're welcome.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>