From owner-freebsd-questions Fri Jul 13 11:45:46 2001 Delivered-To: freebsd-questions@freebsd.org Received: from gandalf.vi.bravenet.com (gandalf.bravenet.com [139.142.105.50]) by hub.freebsd.org (Postfix) with SMTP id 6588337B403 for ; Fri, 13 Jul 2001 11:45:42 -0700 (PDT) (envelope-from graham@bravenet.com) Received: (qmail 23563 invoked from network); 13 Jul 2001 18:49:06 -0000 Received: from unknown (HELO grahamwork) (192.168.30.9) by 0 with SMTP; 13 Jul 2001 18:49:06 -0000 From: "Graham White" To: "FreeBSD-questions" Subject: Newbie Bash-question Date: Fri, 13 Jul 2001 11:48:35 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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