Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Apr 2000 12:08:44 -0400
From:      "Crist J. Clark" <cjc@cc942873-a.ewndsr1.nj.home.com>
To:        freebsd-questions@freebsd.org
Subject:   Comparing Floats in a /bin/sh Script
Message-ID:  <20000406120827.A4198@cc942873-a.ewndsr1.nj.home.com>

next in thread | raw e-mail | index | archive | help
[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




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