
May 19th, 2000, 06:36 AM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
>>It DOES display it when running the script from console.
Have you tried the full path to 'top' command like..
$cpu_usage = `/usr/bin/top -n 1 | grep "rc5des"`;
I do not know exactly what are you trying to do with this script, maybe the following script should help you in some ways..
############################################
#!/usr/local/bin/perl
print "Content-type: text/htmlnn";
@top = `/usr/bin/top -n 1 | grep rc5des`;
chop(@top);
foreach $value (@top) {
($pid,$username,$pri,$nice,$size,$res,$state,$time,$wcpu,$cpu,$command) = split(/s+/,$value);
print "$cpun";
}
exit;
|