Can anyone tell me how to maintain the decimal point when doing arithmetic in the Korn shell ?
I need to figure out how much space is used on thousands of disk drives given Capacity and Percent Utilized values.
Here is an example of my code and one disk sample input:
CAPACITY=1.9 (this is GB)
PCT_UTIL=99.9 (this is %)
(( USEDSPACE=(CAPACITY / 100) * PCT_UTIL ))
USEDSPACE = 0 ( it should be 1.8 or so GB)
The decimal is dropped and the result is zero. How can I get an accurate value ?
Thanks.
LJS
I need to figure out how much space is used on thousands of disk drives given Capacity and Percent Utilized values.
Here is an example of my code and one disk sample input:
CAPACITY=1.9 (this is GB)
PCT_UTIL=99.9 (this is %)
(( USEDSPACE=(CAPACITY / 100) * PCT_UTIL ))
USEDSPACE = 0 ( it should be 1.8 or so GB)
The decimal is dropped and the result is zero. How can I get an accurate value ?
Thanks.
LJS