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 -->
  #4 (permalink)  
Old 03-06-2006
blowtorch's Avatar
blowtorch blowtorch is offline
Supporter
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,332
Quote:
Originally Posted by matrixmadhan
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
Nice one. Instead of assuming single precision, why not use 100 as the multiplier and check against 9000?
Reply With Quote