Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 May 1998 08:38:09 -0500
From:      Jon Hamilton <hamilton@pobox.com>
To:        Child <child@mctcnet.net>
Cc:        questions@FreeBSD.ORG
Subject:   Re: sh/csh sums? 
Message-ID:  <199805161336.GAA15216@hub.freebsd.org>
In-Reply-To: Your message of "Sat, 16 May 1998 00:31:23 CDT." <Pine.BSF.3.96.980516002949.4486A-100000@sommer.dyn.ml.org> 

next in thread | previous in thread | raw e-mail | index | archive | help

In message <Pine.BSF.3.96.980516002949.4486A-100000@sommer.dyn.ml.org>, Child w
rites:
} HI all
} 
} I am looking for a way to get sh/csh to do simple sums
} ie 145553/1024 
} 
} thanks
} JS

To pick a nit, that's not a sum, but to answer your question as it applies to
sh:

$ echo $((145553/1024))
142

Most older versions of sh will either not have this feature, or it'll be
limited to addition and subtraction.  Newer (POSIX-ized) versions generally
do OK in this regard.  

-- 
   Jon Hamilton  
   hamilton@pobox.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?199805161336.GAA15216>