From owner-freebsd-questions Tue Jan 11 2: 9:24 2000 Delivered-To: freebsd-questions@freebsd.org Received: from linux.ssc.nsu.ru (linux.ssc.nsu.ru [193.124.209.130]) by hub.freebsd.org (Postfix) with SMTP id 2D36714DEA for ; Tue, 11 Jan 2000 02:08:36 -0800 (PST) (envelope-from danfe@ssc.nsu.ru) Received: (qmail 26408 invoked from network); 11 Jan 2000 10:05:32 -0000 Received: from inet.ssc.nsu.ru (62.76.110.12) by hub.freebsd.org with SMTP; 11 Jan 2000 10:05:32 -0000 Received: from localhost (danfe@localhost) by inet.ssc.nsu.ru (8.9.3/8.9.3) with ESMTP id QAA12430; Tue, 11 Jan 2000 16:05:01 +0600 Date: Tue, 11 Jan 2000 16:05:01 +0600 (NOVT) From: "Alexey N. Dokuchaev" To: Sheldon Hearn Cc: dl@tyfon.net, "[FreeBSD-Questions-List] (E-post)" Subject: Re: mathematics in sh In-Reply-To: <99240.947584237@axl.noc.iafrica.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 11 Jan 2000, Sheldon Hearn wrote: > > > On Tue, 11 Jan 2000 09:49:28 +0100, Dan Larsson wrote: > > > Is it possible to do mathematical ( simple calculations such as > > ($a + $b)/$c) calculations in sh? > > > Or is perl better to use in this case? > > Perl's better if you need floating point values. But for simple integer > arithmetic, /bin/sh works fine. > > See the Arithmetic Expansion section of the sh(1) manual page. > > Ciao, > Sheldon. > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > I always use echo $((1234*25)) when trying to convert rubbles to bucks ;-) it also understands |, ^, & (binary), 0x... and much more. ,--------------------------------------, ____ ___ _______ | Alexey N. Dokuchaev, more commonly | / __/______ ___ / _ )/ __/ _ \ | known as DAN Fe | / _// __/ -_) -_) _ |\ \/ // / | | /_/ /_/ __/__/ /____/___/____/ | Novosibirsk State University `-------- The Power to Serve --------, | Scientific Study Center Computer Lab | | | | email: danfe@inet.ssc.nsu.ru homepage: http://inet.ssc.nsu.ru/~danfe/ | | ICQ UIN: 38934845 | `---------------------------------------------------------------------------' A good conspiracy is unprovable. I mean, if you can prove it, it means they screwed up somewhere along the line. Jerry Fletcher from Conspiracy Theory To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message