Question: how to calculate percentage value in shell script?
Answer: 100 * item / total yields the truncated result of the integer division as a percentage. 1000 * item / total % 10 >= 5 ? ...  Note how there's no need to prefix variable references with $ inside an arithmetic expansion $((...)) .