From owner-freebsd-questions Fri Aug 23 0:38: 3 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8417837B400 for ; Fri, 23 Aug 2002 00:38:00 -0700 (PDT) Received: from kobold.compt.com (TBextgw.compt.com [209.115.146.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id A634A43E42 for ; Fri, 23 Aug 2002 00:37:59 -0700 (PDT) (envelope-from klaus@kobold.compt.com) Date: Fri, 23 Aug 2002 03:37:54 -0400 From: Klaus Steden To: "Christopher J. Umina" Cc: Edwin Groothuis , freebsd-questions@FreeBSD.ORG Subject: Re: expr replacement Message-ID: <20020823033754.K66371@cthulu.compt.com> References: <20020823063308.GL785@k7.mavetju> <20020823025441.O44828-100000@216-164-225-145.c3-0.wth-ubr2.sbo-wth.ma.cable.rcn.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020823025441.O44828-100000@216-164-225-145.c3-0.wth-ubr2.sbo-wth.ma.cable.rcn.com>; from uminac@216-164-225-145.c3-0.wth-ubr2.sbo-wth.ma.cable.rcn.com on Fri, Aug 23, 2002 at 02:55:57AM -0400 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 > When I do that it doesn't get the values for some reason and it gives me a > divide by zero error... I think it's because Perl's looking for it's own > variables, not the ones set in the shell script. But I can't think of a > way to put them in there. The problem with expr is that I can't get to 2 > decimal places. I really need that. > If you don't like awk, or perl still doesn't work, you can also try 'bc'. i.e. i=13412; j=2; k=`echo "$i / $j" |bc`; echo $k 6706 hth, Klaus To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message