Calculating percentages in bash Dividing in bash will cause problems if the result is below zero. This is a problem when you’re trying to work out percentages. For example, if you simply want to divide 1 by 2 the result should be 0.5. However, bash returns the result 0:
user@computer:~> echo $(( 1 / 2 […]
Recent Comments