[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: BASH question



Ed Greshko wrote:
Andy Green wrote:
M.Lewis wrote:
I thought this was simple, but I've not yet been able to figure out
what is wrong.

#!/bin/sh

PERMINUTE=$((28.95/432000))
No floating point support :-)  But even then, be liberal with spaces

PERMINUTE=$(( 29 / 432000 ))

Right...and since bash only works with integers the result of this
calculation is "0".


That explains the '0' value.

--

 Every program is either trivial or it contains at least one bug.
  02:35:01 up  3:18,  1 user,  load average: 0.19, 0.37, 0.40

 Linux Registered User #241685  http://counter.li.org


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]