Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jul 2001 11:48:35 -0700
From:      "Graham White" <graham@bravenet.com>
To:        "FreeBSD-questions" <FreeBSD-questions@FreeBSD.ORG>
Subject:   Newbie Bash-question
Message-ID:  <CIEEIPPHEMBKLIMPEJFBCEAOCBAA.graham@bravenet.com>

next in thread | raw e-mail | index | archive | help
I'm very new to scripting so bear with me. I'm trying to generate an e-mail
when a load
average on a server exceeds a certain point.  I can extract out the
appropriate field with the command sequence below. I am however getting an
integer expected error for the $LOAD
variable.  I guess its pulling out the field as a string. Is there any way
to convert it to an integer? Also is there an issue with the numbers being
decimal? I hope this makes sense, thanks.



LOAD=`uptime | sed -e "s/.*load average: \(.*\...\), .*\..., .*\.../\1/" -e
"s/ //g"| cut -d"," -f5`

if [ $LOAD -gt .30 ] #integer expected here.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CIEEIPPHEMBKLIMPEJFBCEAOCBAA.graham>