awk ">" number comparisons; scripting help request



OK, it's NOT Solaris per se, but scripting and awk I have a problem
with: can you help or point me towards another resource?

consider the awk statement where $9 is greater than the threshold, I
print the entire line:

root@gumby prstat -s cpu -n 10 2 1 | egrep -v "NICE" | awk -F" " '($9 >
"20%") {print $0}'
701 root 1047M 911M sleep 59 0 2:18:36 9.8% java/62

What I am trying to accomplish is to catch a java process that goes
haywire and consumes more than 40% of the cpu and makes the box crawl
for interactive users.

sometimes prstat prints the results as a whole number like "20%" and
sometimes it prints a decimal like "1.5%" or "0.3%".

The awk -F" " '($9 > "X%") produces unpredictable results. Anyone have
a technique or work around for normalizing the X% to a consistant
format? Does gawk have better ">" operations?

Kind regards
JV711
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
_______________________________________________
sunmanagers mailing list
sunmanagers@xxxxxxxxxxxxxxx
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



Relevant Pages

  • Re: The smartest band in the world?
    ... I mainly use grep, but I'm ... going to learn awk and sed and improve my bash scripting. ... Oracle accreditation coure, well in the grad courses at least, everything ...
    (alt.guitar)
  • Re: The smartest band in the world?
    ... I mainly use grep, but I'm going to learn awk and sed and improve my bash scripting. ... mostly taching Oracle and at the subjects completion you can do the Oracle accreditation coure, well in the grad courses at least, everything seems to have a proprietry product focus. ...
    (alt.guitar)
  • Re: Adding up multiple files (like matrix addition)
    ... Is there a nice way to do this with Unix scripting, ... the evils of the C shell. ... Awk is shell-advocate neutral. ... But with modern computers, why do the extra ...
    (comp.unix.shell)
  • Re: FTP in gawk
    ... I'm a newbie to this group (not a newbie to awk, shells, ... scripting, unix, etc). ... I have my reasons for using gawk to do this. ...
    (comp.lang.awk)
  • Re: Scripting Problem
    ... >to do some scripting but am running into the following problem: ... Awk can be used a well. ... \ / Ribbon Campaign ... unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe ...
    (RedHat)