The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 03-06-2006
matrixmadhan matrixmadhan is offline
Technorati Master
 

Join Date: Mar 2005
Location: k-tier distributed caching
Posts: 2,733
Quote:
Note, this will not work if the % value is something like 90.7%. It has to be 91 or more.
this one would do,

assuming single precision,

Code:
prstat 0 1 | grep weblogic | awk '{print $9}' | sed 's/%//' | while line do
 if [ `echo $line \* 10 | bc` -gt 900 ]
 then
 echo "$line greater than 90"
 else
 echo "$line not greater than 90"
 fi
 done
Reply With Quote