Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to compare 1

Status
Not open for further replies.

we2aresame

Technical User
Feb 10, 2003
128
CA
I'm monitor the paging space usage, the paging space usage data like xx%, I want to compare which one is bigger, like

If xx%>50% then ...

How can I make it? Thanks.
 
Sorry for my bad English.
I just want to compare which one is bigger,xx% or 50%?
I don't know how to compare it.
 
Can you please post your script and some example datas you want to compare, telling us where you're stuck and which scripting language you use.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
I try to use K shell on AIX to do this.

lsps -s | grep 2048|awk '{print $2}' will get the usage of paging space, the data like xx%

If (lsps -s | grep 2048| awk '{print $2}')> 50%
then
send mail to me
if

The difficult part for me is, I don't know how to compare xx% and 50%. xx%>50% couldn't work. Many thanks.
 
You can try something like this:
xx=`lsps -s | awk '
/2048/{x=$2;sub(/%/,"",x);printf "%d",x}'`
if [ "$xx" -gt 50 ]; then
YourSendStuffHere
fi


Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top