From owner-freebsd-questions Thu Apr 6 9: 8:51 2000 Delivered-To: freebsd-questions@freebsd.org Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (Postfix) with ESMTP id 1139937BB08 for ; Thu, 6 Apr 2000 09:08:47 -0700 (PDT) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.9.3/8.9.3) id MAA04235 for freebsd-questions@freebsd.org; Thu, 6 Apr 2000 12:08:44 -0400 (EDT) (envelope-from cjc) Date: Thu, 6 Apr 2000 12:08:44 -0400 From: "Crist J. Clark" To: freebsd-questions@freebsd.org Subject: Comparing Floats in a /bin/sh Script Message-ID: <20000406120827.A4198@cc942873-a.ewndsr1.nj.home.com> Reply-To: cjclark@home.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [Kind of a non-FreeBSD specific, /bin/sh question, but it also kind of is, since the CL tools one might use vary from system to system.] I want to compare two floating point numbers in a /bin/sh script. I cannot seem to find an easy way to do so. The best I've come up with is, if awk "BEGIN { if ( $A < $B ) { exit 0 } else { exit 1 } }"; then ... There's got to be a better way? -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message