I'd like to calculate some information from a file but division does not work. If I change the /
to a +
or -
, this calculation it doing right. Any ideas?
#!/bin/sh
FILE=/tmp/stats
for EMPTY in $(cat $FILE |sed '1!d'); do (echo "Empty Servers $EMPTY | Empty-Servers=$EMPTY;"); done
for SERVERS in $(cat $FILE |sed '2!d'); do (echo "Total Servers $SERVERS | Total=$SERVERS;"); done
PERCENT=$(((EMPTY / SERVERS)*100))
echo $PERCENT
bash
(because of tag) orsh
(first line of script)?