All, Thanks for your assistance in helping me with my issues.
The script posted by Rob on the 7th works fantastic. However I've discovered that we have a lot of systems out there running a previous version of perl, so much so that I am getting errors within the util.pm. "Array found where operator expected at ......" Is there another way to calculate the average CPU from a single column which will work in a previous version of perl? Thanks, Jase. On Dec 8, 12:27 pm, [EMAIL PROTECTED] (Dr.Ruud) wrote: > John W . Krahn schreef: > > > Rodrick Brown: > >> John W. Krahn: > >>> perl -ane'$total+=$F[4]}{printf"Avg: %.2f\n",$total/$.' > >>> /tmp/filename > > >> Hi John please explain how exactly $F[4] works? how is it set? > > Use -MO=Deparse to show you what Perl code your command line expression > was compiled to. > > $ perl -MO=Deparse -ane'> $total+=$F[4]}{printf"Avg: %.2f\n",$total/$. > > ' > > LINE: while (defined($_ = <ARGV>)) { > our(@F) = split(" ", $_, 0); > $total += $F[4];} > > { > printf "Avg: %.2f\n", $total / $.;} > > -e syntax OK > > -- > Affijn, Ruud > > "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/